lib/asciidoctor/sample/converter.rb in metanorma-sample-1.0.10 vs lib/asciidoctor/sample/converter.rb in metanorma-sample-1.3.8

- old
+ new

@@ -32,10 +32,11 @@ end end end def metadata_committee(node, xml) + return unless node.attr("committee") xml.editorialgroup do |a| a.committee node.attr("committee"), **attr_code(type: node.attr("committee-type")) i = 2 while node.attr("committee_#{i}") do @@ -44,14 +45,10 @@ i += 1 end end end - def metadata_status(node, xml) - xml.status(**{ format: "plain" }) { |s| s << node.attr("status") } - end - def metadata_id(node, xml) docstatus = node.attr("status") dn = node.attr("docnumber") if docstatus abbr = IsoDoc::Sample::Metadata.new("en", "Latn", {}). @@ -78,11 +75,11 @@ def metadata_security(node, xml) security = node.attr("security") || return xml.security security end - def metadata(node, xml) + def metadata_ext(node, xml) super metadata_security(node, xml) end def title_validate(root) @@ -93,12 +90,12 @@ result = ["<?xml version='1.0' encoding='UTF-8'?>\n<sample-standard>"] @draft = node.attributes.has_key?("draft") result << noko { |ixml| front node, ixml } result << noko { |ixml| middle node, ixml } result << "</sample-standard>" - result = textcleanup(result.flatten * "\n") + result = textcleanup(result) ret1 = cleanup(Nokogiri::XML(result)) - validate(ret1) + validate(ret1) unless @novalid ret1.root.add_namespace(nil, EXAMPLE_NAMESPACE) ret1 end def doctype(node)