lib/isodoc/presentation_function/docid.rb in isodoc-2.12.6 vs lib/isodoc/presentation_function/docid.rb in isodoc-2.12.7

- old
+ new

@@ -7,11 +7,11 @@ end def pref_ref_code(bib) bib["suppress_identifier"] == "true" and return nil ret = bib.xpath(ns("./docidentifier[@scope = 'biblio-tag']")) - ret.empty? or return ret.map(&:text) + ret.empty? or return ret.map { |x| to_xml(x.children) } ret = pref_ref_code_parse(bib) or return nil ins = bib.at(ns("./docidentifier[last()]")) ret.reverse_each do |r| ins.next = "<docidentifier scope='biblio-tag'>#{docid_l10n(r)}</docidentifier>" end @@ -48,17 +48,17 @@ id end def bracket_if_num(num) num.nil? and return nil - num = num.text.sub(/^\[/, "").sub(/\]$/, "") + num = to_xml(num.children).sub(/^\[/, "").sub(/\]$/, "") /^\d+$/.match?(num) and return "[#{num}]" num end def unbracket1(ident) ident.nil? and return nil - ident.is_a?(String) or ident = ident.text + ident.is_a?(String) or ident = to_xml(ident.children) ident.sub(/^\[/, "").sub(/\]$/, "") end def unbracket(ident) if ident.respond_to?(:size)