mdc/lib/parsing/parser.rb
##
# Perform a second pass to replace links and footnotes in the reference
# Format (i.e. [...] and [^...]) with inline versions.
# @param [Domain::Presentation] presentation Storage of results
Perform a second pass to replace links and footnotes in the reference
Format  with inline versions.
Perform a second pass to replace links and footnotes in the reference Format with inline versions .
def second_pass(presentation)
      presentation.each do |chapter|
        footnotes = chapter.footnotes
        links = chapter.links
        chapter.each_content_element do |type, content|
          if [ Domain::Text,
               Domain::OrderedListItem,
               Domain::UnorderedListItem,
               Domain::Quote,
               Domain::Question,
               Domain::Important ].include? type
            footnotes.each do |footnote|
              ref, inline = MarkdownLine.footnote_ref_to_inline(footnote)
              content.gsub!(ref, inline)
            end
            links.each do |link|
              ref, inline = MarkdownLine.link_ref_to_inline(link)
              content.gsub!(ref, inline)
            end
          end
        end
      end
    end
def second_pass ( presentation ) presentation . each do | chapter | footnotes = chapter . footnotes links = chapter . links chapter . each_content_element do | type , content | if [ Domain :: Text , Domain :: OrderedListItem , Domain :: UnorderedListItem , Domain :: Quote , Domain :: Question , Domain :: Important ] . include? type footnotes . each do | footnote | ref , inline = MarkdownLine . footnote_ref_to_inline ( footnote ) content . gsub! ( ref , inline ) end links . each do | link | ref , inline = MarkdownLine . link_ref_to_inline ( link ) content . gsub! ( ref , inline ) end end end end end
Perform a second pass to replace links and footnotes in the reference
Format (i.e.
Perform a second pass to replace links and footnotes in the reference Format ( i . e .
# Types of content to do the footnote replacement with # Replace the footnote references with the footnote
presentation
<not_specific>
<not_specific>
presentation Storage of results
presentation Storage of results