lib/isodoc/iso/xref_section.rb in metanorma-iso-2.3.0 vs lib/isodoc/iso/xref_section.rb in metanorma-iso-2.3.1

- old
+ new

@@ -1,14 +1,13 @@ module IsoDoc module Iso class Xref < IsoDoc::Xref # we can reference 0-number clauses in introduction def introduction_names(clause) - return if clause.nil? - + clause.nil? and return clause.at(ns("./clause")) and - @anchors[clause["id"]] = { label: "0", level: 1, type: "clause", + @anchors[clause["id"]] = { label: nil, level: 1, type: "clause", xref: clause.at(ns("./title"))&.text } i = Counter.new clause.xpath(ns("./clause")).each do |c| i.increment(c) section_names1(c, "0.#{i.print}", 2) @@ -41,10 +40,10 @@ # retaining subtype for the semantics def section_names1(clause, num, level) @anchors[clause["id"]] = { label: num, level: level, xref: num, subtype: "clause" } i = Counter.new - clause.xpath(ns("./clause | ./terms | ./term | ./definitions | "\ + clause.xpath(ns("./clause | ./terms | ./term | ./definitions | " \ "./references")) .each do |c| i.increment(c) section_names1(c, "#{num}.#{i.print}", level + 1) end