lib/asciidoctor/iso/cleanup.rb in metanorma-iso-1.8.1 vs lib/asciidoctor/iso/cleanup.rb in metanorma-iso-1.8.2

- old
+ new

@@ -63,12 +63,16 @@ def format_ref(ref, type) ref = ref.sub(/ \(All Parts\)/i, "") super end - TERM_CLAUSE = "//sections//terms".freeze + TERM_CLAUSE = "//sections//terms | "\ + "//sections//clause[descendant::terms][not(descendant::definitions)]" + .freeze + PUBLISHER = "./contributor[role/@type = 'publisher']/organization".freeze + OTHERIDS = "@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or "\ "@type = 'ISBN'".freeze def pub_class(bib) return 1 if bib.at("#{PUBLISHER}[abbreviation = 'ISO']") @@ -152,14 +156,22 @@ next if pub_class(b) > 2 next unless (s = b.at("./status/stage")) && (s.text.to_i < 60) id = b.at("docidentifier").text b.at("./language | ./script | ./abstract | ./status") - .previous = <<~NOTE - <note type="Unpublished-Status"> - <p>#{@i18n.under_preparation.sub(/%/, id)}</p></note> - NOTE + .previous = %(<note type="Unpublished-Status"> + <p>#{@i18n.under_preparation.sub(/%/, id)}</p></note>) end + end + + def termdef_boilerplate_insert(xmldoc, isodoc, once = false) + once = true + super + end + + def term_defs_boilerplate_cont(src, term, isodoc) + @vocab and src.empty? and return + super end end end end