lib/isodoc/presentation_function/section.rb in isodoc-2.11.0 vs lib/isodoc/presentation_function/section.rb in isodoc-2.11.1

- old
+ new

@@ -19,16 +19,21 @@ clause1(f) end end + def unnumbered_clause?(elem) + !elem.ancestors("boilerplate, metanorma-extension").empty? || + @suppressheadingnumbers || elem["unnumbered"] || + elem.at("./ancestor::*[@unnumbered = 'true']") + end + def clause1(elem) level = @xrefs.anchor(elem["id"], :level, false) || (elem.ancestors("clause, annex").size + 1) t = elem.at(ns("./title")) and t["depth"] = level - !elem.ancestors("boilerplate, metanorma-extension").empty? || - @suppressheadingnumbers || elem["unnumbered"] and return + unnumbered_clause?(elem) and return lbl = @xrefs.anchor(elem["id"], :label, elem.parent.name != "sections") or return prefix_name(elem, "<tab/>", "#{lbl}#{clausedelim}", "title") end @@ -63,9 +68,10 @@ def annex1(elem) lbl = @xrefs.anchor(elem["id"], :label) if t = elem.at(ns("./title")) t.children = "<strong>#{to_xml(t.children)}</strong>" end + unnumbered_clause?(elem) and return prefix_name(elem, "<br/><br/>", lbl, "title") end def single_term_clause_retitle(elem) t = elem.at(ns("./terms | ./definitions | ./references"))