lib/isodoc/presentation_function/xrefs.rb in isodoc-2.11.1 vs lib/isodoc/presentation_function/xrefs.rb in isodoc-2.11.2

- old
+ new

@@ -114,11 +114,11 @@ def gather_xref_locations(node) node.xpath(ns("./location")).each_with_object([]) do |l, m| type = @xrefs.anchor(l["target"], :type) m << { conn: l["connective"], target: l["target"], - type: type, node: l, elem: @xrefs.anchor(l["target"], :elem), + type:, node: l, elem: @xrefs.anchor(l["target"], :elem), container: @xrefs.anchor(l["target"], :container, false) || %w(termnote).include?(type) } end end @@ -130,17 +130,17 @@ end end def combine_conn(list) list.size == 1 and list.first[:label] - if list[1..-1].all? { |l| l[:conn] == "and" } + if list[1..].all? { |l| l[:conn] == "and" } @i18n.boolean_conj(list.map { |l| loc2xref(l) }, "and") - elsif list[1..-1].all? { |l| l[:conn] == "or" } + elsif list[1..].all? { |l| l[:conn] == "or" } @i18n.boolean_conj(list.map { |l| loc2xref(l) }, "or") else ret = loc2xref(list[0]) - list[1..-1].each { |l| ret = i18n_chain_boolean(ret, l) } + list[1..].each { |l| ret = i18n_chain_boolean(ret, l) } ret end end def i18n_chain_boolean(value, entry) @@ -154,10 +154,10 @@ locs.all? { |l| l[:container] == locs.first[:container] }) && locs.all? { |l| l[:type] == locs[0][:type] } end def capitalise_xref(node, linkend, label) - linktext = linkend.gsub(/<[^>]+>/, "") + linktext = linkend.gsub(/<[^<>]+>/, "") (label && !label.empty? && /^#{Regexp.escape(label)}/.match?(linktext)) || linktext[0, 1].match?(/\p{Upper}/) and return linkend node["case"] and return Common::case_with_markup(linkend, node["case"], @script) capitalise_xref1(node, linkend)