lib/asciidoctor/iso/front.rb in metanorma-iso-1.3.0 vs lib/asciidoctor/iso/front.rb in metanorma-iso-1.3.1

- old
+ new

@@ -9,13 +9,13 @@ module Asciidoctor module ISO class Converter < Standoc::Converter def metadata_id(node, xml) iso_id(node, xml) - node.attr("tc-docnumber") and - xml.docidentifier(node.attr("tc-docnumber"), - **attr_code(type: "iso-tc")) + node&.attr("tc-docnumber")&.split(/,\s*/)&.each do |n| + xml.docidentifier(n, **attr_code(type: "iso-tc")) + end xml.docnumber node&.attr("docnumber") end def iso_id(node, xml) return unless node.attr("docnumber") @@ -43,17 +43,21 @@ dn += "-#{part}" if part dn += "-#{subpart}" if subpart dn end + def id_stage_abbr(stage, substage, node) + IsoDoc::Iso::Metadata.new("en", "Latn", {}). + stage_abbrev(stage, substage, node.attr("iteration"), + node.attr("draft")) + end + def id_stage_prefix(dn, node) stage = get_stage(node) substage = get_substage(node) if stage && (stage.to_i < 60 || stage.to_i == 60 && substage.to_i < 60) - abbr = IsoDoc::Iso::Metadata.new("en", "Latn", {}). - stage_abbrev(stage, substage, node.attr("iteration"), - node.attr("draft")) - dn = "/#{abbr} #{dn}" # prefixes added in cleanup + abbr = id_stage_abbr(stage, substage, node) + dn = "/#{abbr} #{dn}" unless abbr.nil? || abbr.empty? # prefixes added in cleanup else dn += ":#{node.attr("copyright-year")}" if node.attr("copyright-year") end dn end