Method: IsoDoc::HtmlFunction::Html#update_footnote_filter

Defined in:
lib/isodoc/html_function/html.rb

#update_footnote_filter(fn, x, i, seen) ⇒ Object



221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/isodoc/html_function/html.rb', line 221

def update_footnote_filter(fn, x, i, seen)
  if seen[fn.text]
    x.at("./sup").content = seen[fn.text][:num].to_s
    fn.remove unless x["href"] == seen[fn.text][:href]
    x["href"] = seen[fn.text][:href]
  else
    seen[fn.text] = { num: i, href: x["href"] }
    x.at("./sup").content = i.to_s
    i += 1
  end
  [i, seen]
end