app/helpers/activity_helper.rb
# Add a footnote reference after each anchor, and add the anchor href
# to the hash of footnotes (with the footnote index as key)
Add a footnote reference after each anchor, and add the anchor href
to the hash of footnotes (with the footnote index as key)
Add a footnote reference after each anchor and add the anchor href to the hash of footnotes ( with the footnote index as key )
def process_url_footnotes(doc)
      @footnote_urls = {}
      i = 1
      doc.css('a').each do |anchor|
        url = anchor.attribute('href')&.value
        next if url.nil?
        url = absolutize_url(url)
        next if url.nil?
        ref = "<sup class='footnote-url visible-print-inline'>#{i}</sup>"
        anchor.add_next_sibling ref
        @footnote_urls[i.to_s] = url
        i += 1
      end
    end
def process_url_footnotes ( doc ) @footnote_urls = { } i = 1 doc . css ( 'a' ) . each do | anchor | url = anchor . attribute ( 'href' ) &. value next if url . nil? url = absolutize_url ( url ) next if url . nil? ref = "<sup class='footnote-url visible-print-inline'>#{i}</sup>" anchor . add_next_sibling ref @footnote_urls [ i . to_s ] = url i += 1 end end
Add a footnote reference after each anchor, and add the anchor href
to the hash of footnotes (with the footnote index as key)
Add a footnote reference after each anchor and add the anchor href to the hash of footnotes ( with the footnote index as key )
doc