Method: Metanorma::CollectionRenderer#docrefs

Defined in:
lib/metanorma/collection_renderer.rb

#docrefs(elm, builder) ⇒ Object

Parameters:

  • elm (Nokogiri::XML::Element)
  • builder (Nokogiri::XML::Builder)


154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/metanorma/collection_renderer.rb', line 154

def docrefs(elm, builder)
  elm.xpath(ns("./docref[@index = 'true']")).each do |d|
    ident = d.at(ns("./identifier")).children.to_xml
    ident = @c.decode(@isodoc.docid_prefix(nil, ident))
    builder.li do |li|
      li.a href: index_link(d, ident) do |a|
        a << ident.split(/([<>&])/).map do |x|
          /[<>&]/.match?(x) ? x : @c.encode(x, :hexadecimal)
        end.join
      end
    end
  end
end