diff --git a/lib/isodoc/presentation_function/block.rb b/lib/isodoc/presentation_function/block.rb index a264592b..c1486053 100644 --- a/lib/isodoc/presentation_function/block.rb +++ b/lib/isodoc/presentation_function/block.rb @@ -119,8 +119,8 @@ def amend(docxml) end def amend1(elem) - elem.xpath(ns("./locality | localityStack | autonumber | " \ - "classification | contributor")).each(&:remove) + elem.xpath(ns("./locality | ./localityStack | ./autonumber | " \ + "./classification | ./contributor")).each(&:remove) elem.xpath(ns("./newcontent")).each { |a| a.name = "quote" } elem.xpath(ns("./description")).each { |a| a.replace(a.children) } elem.replace(elem.children) diff --git a/lib/isodoc/presentation_function/metadata.rb b/lib/isodoc/presentation_function/metadata.rb index d486531f..2450abaa 100644 --- a/lib/isodoc/presentation_function/metadata.rb +++ b/lib/isodoc/presentation_function/metadata.rb @@ -5,6 +5,12 @@ def metadata(docxml) fonts_metadata(docxml) attachments_extract(docxml) preprocess_xslt_insert(docxml) + localized_strings(docxml) + a = docxml.at(ns("//metanorma-extension")) or return + a.elements.empty? and a.remove + end + + def localized_strings(docxml) a = docxml.at(ns("//bibdata")) or return a.next = "#{i8n_name(trim_hash(@i18n.get), '').join}" \ @@ -69,7 +75,7 @@ def fonts_metadata(xmldoc) def presmeta_insert_pt(xmldoc) xmldoc.at(ns("//presentation-metadata")) || - extension_insert_pt(xml).children.last + extension_insert_pt(xmldoc).children.last end def presmeta(name, value) diff --git a/spec/isodoc/blocks_notes_spec.rb b/spec/isodoc/blocks_notes_spec.rb index 0fb5a965..5abf3365 100644 --- a/spec/isodoc/blocks_notes_spec.rb +++ b/spec/isodoc/blocks_notes_spec.rb @@ -105,12 +105,16 @@ OUTPUT - expect(Xml::C14n.format(strip_guid(IsoDoc::PresentationXMLConvert.new(presxml_options) - .convert("test", input, true)))).to be_equivalent_to Xml::C14n.format(presxml) + expect(Xml::C14n.format(strip_guid(IsoDoc::PresentationXMLConvert + .new(presxml_options) + .convert("test", input, true)))) + .to be_equivalent_to Xml::C14n.format(presxml) expect(Xml::C14n.format(IsoDoc::HtmlConvert.new({}) - .convert("test", presxml, true))).to be_equivalent_to Xml::C14n.format(html) + .convert("test", presxml, true))) + .to be_equivalent_to Xml::C14n.format(html) expect(Xml::C14n.format(IsoDoc::WordConvert.new({}) - .convert("test", presxml, true))).to be_equivalent_to Xml::C14n.format(doc) + .convert("test", presxml, true))) + .to be_equivalent_to Xml::C14n.format(doc) end it "processes sequences of notes" do diff --git a/spec/isodoc/presentation_xml_metadata_spec.rb b/spec/isodoc/presentation_xml_metadata_spec.rb index 1aa1dbeb..d66daef1 100644 --- a/spec/isodoc/presentation_xml_metadata_spec.rb +++ b/spec/isodoc/presentation_xml_metadata_spec.rb @@ -202,6 +202,7 @@ presxml = <<~OUTPUT + font-license-agreement no-install-fonts @@ -214,6 +215,7 @@ fonts font1 + Table of contents