lib/metanorma/un/converter.rb in metanorma-un-0.10.3 vs lib/metanorma/un/converter.rb in metanorma-un-0.10.4
- old
+ new
@@ -34,17 +34,16 @@
Metanorma::Utils::asciidoc_sub(text)
end
def title(node, xml)
["en"].each do |lang|
- xml.title **{ type: "main", language: lang,
- format: "text/plain" } do |t|
+ xml.title type: "main", language: lang, format: "text/plain" do |t|
t << (asciidoc_sub(node.attr("title")) || node.title)
end
node.attr("subtitle") and
- xml.title **{ type: "subtitle", language: lang,
- format: "text/plain" } do |t|
+ xml.title type: "subtitle", language: lang,
+ format: "text/plain" do |t|
t << asciidoc_sub(node.attr("subtitle"))
end
end
end
@@ -53,10 +52,11 @@
if docstatus = node.attr("status")
abbr = IsoDoc::UN::Metadata.new("en", "Latn", "", @i18n)
.stage_abbr(docstatus)
dn = "#{dn}(#{abbr})" unless abbr.empty?
end
+ id = node.attr("docidentifier") and dn = id
xml.docidentifier { |i| i << dn }
xml.docnumber { |i| i << node.attr("docnumber") }
end
def metadata_distribution(node, xml)
@@ -177,10 +177,10 @@
no_number_subheadings(xmldoc) if @no_number_subheadings
para_to_clause(xmldoc)
end
def no_number_subheadings(xmldoc)
- xmldoc.xpath("//sections/clause | "\
+ xmldoc.xpath("//sections/clause | " \
"//sections/definitions | //annex").each do |s|
s.xpath(".//clause | .//definitions").each do |c|
c["unnumbered"] = true
end
end