Method: IsoDoc::HtmlFunction::Html#update_footnote_filter

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

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



159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/isodoc/html_function/html.rb', line 159

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