Method: IsoDoc::PresentationXMLConvert#eref_target

Defined in:
lib/isodoc/presentation_function/erefs.rb

#eref_target(node) ⇒ Object



232
233
234
235
236
237
238
# File 'lib/isodoc/presentation_function/erefs.rb', line 232

def eref_target(node)
  u = eref_url(node["bibitemid"]) or return nil
  url = suffix_url(u[:link])
  anchor = node.at(ns(".//locality[@type = 'anchor']"))
  /^#/.match?(url) || !anchor and return { link: url, type: u[:type] }
  { link: "#{url}##{anchor.text.strip}", type: u[:type] }
end