diff --git a/lib/metanorma/csa/biblio.rng b/lib/metanorma/csa/biblio.rng index c20adb5..5514b86 100644 --- a/lib/metanorma/csa/biblio.rng +++ b/lib/metanorma/csa/biblio.rng @@ -1316,7 +1316,7 @@ commentaryOf hasCommentary related - complements + hasComplement complementOf obsoletes obsoletedBy diff --git a/lib/metanorma/csa/isodoc.rng b/lib/metanorma/csa/isodoc.rng index 1b9c0a6..f1d1105 100644 --- a/lib/metanorma/csa/isodoc.rng +++ b/lib/metanorma/csa/isodoc.rng @@ -1580,7 +1580,7 @@ - + diff --git a/lib/metanorma/csa/version.rb b/lib/metanorma/csa/version.rb index affd13d..d6d42a2 100644 --- a/lib/metanorma/csa/version.rb +++ b/lib/metanorma/csa/version.rb @@ -1,5 +1,5 @@ module Metanorma module Csa - VERSION = "2.2.2".freeze + VERSION = "2.2.3".freeze end end diff --git a/spec/isodoc/csaconvert_spec.rb b/spec/isodoc/csaconvert_spec.rb index 6c250d0..cae5926 100644 --- a/spec/isodoc/csaconvert_spec.rb +++ b/spec/isodoc/csaconvert_spec.rb @@ -6,7 +6,7 @@ RSpec.describe IsoDoc::Csa do it "processes default metadata" do csdc = IsoDoc::Csa::HtmlConvert.new({}) - docxml, filename, dir = csdc.convert_init(<<~"INPUT", "test", true) + docxml, _filename, _dir = csdc.convert_init(<<~"INPUT", "test", true) Main Title @@ -74,47 +74,49 @@ INPUT - expect(htmlencode(metadata(csdc.info(docxml, nil)).to_s.gsub(/, :/, ",\n:"))).to be_equivalent_to (<<~OUTPUT) - {:accesseddate=>"XXX", - :agency=>"Ribose", - :authors=>["Fred Nerk", "Julius Caesar"], - :authors_affiliations=>{""=>["Fred Nerk", "Julius Caesar"]}, - :circulateddate=>"XXX", - :confirmeddate=>"XXX", - :copieddate=>"XXX", - :createddate=>"XXX", - :docnumber=>"1000(wd)", - :docnumeric=>"1000", - :doctitle=>"Main Title", - :doctype=>"Standard", - :doctype_display=>"Standard", - :docyear=>"2001", - :draft=>"3.4", - :draftinfo=>" (draft 3.4, 2000-01-01)", - :edition=>"2", - :implementeddate=>"XXX", - :issueddate=>"XXX", - :lang=>"en", - :metadata_extensions=>{"doctype"=>"standard", "editorialgroup"=>{"committee_type"=>"A", "committee"=>"TC"}}, - :obsoleteddate=>"XXX", - :publisheddate=>"XXX", - :publisher=>"Ribose", - :receiveddate=>"XXX", - :revdate=>"2000-01-01", - :revdate_monthyear=>"January 2000", - :roles_authors_affiliations=>{"editor"=>{""=>["Julius Caesar"]}, "full-author"=>{""=>["Fred Nerk"]}}, - :script=>"Latn", - :stage=>"Working Draft", - :stage_display=>"Working Draft", - :stageabbr=>"wd", - :tc=>"TC", - :transmitteddate=>"XXX", - :unchangeddate=>"XXX", - :unpublished=>true, - :updateddate=>"XXX", - :vote_endeddate=>"XXX", - :vote_starteddate=>"XXX"} - OUTPUT + expect(htmlencode(metadata(csdc.info(docxml, nil)) + .to_s.gsub(/, :/, ",\n:"))) + .to be_equivalent_to (<<~OUTPUT) + {:accesseddate=>"XXX", + :agency=>"Ribose", + :authors=>["Fred Nerk", "Julius Caesar"], + :authors_affiliations=>{""=>["Fred Nerk", "Julius Caesar"]}, + :circulateddate=>"XXX", + :confirmeddate=>"XXX", + :copieddate=>"XXX", + :createddate=>"XXX", + :docnumber=>"1000(wd)", + :docnumeric=>"1000", + :doctitle=>"Main Title", + :doctype=>"Standard", + :doctype_display=>"Standard", + :docyear=>"2001", + :draft=>"3.4", + :draftinfo=>" (draft 3.4, 2000-01-01)", + :edition=>"2", + :implementeddate=>"XXX", + :issueddate=>"XXX", + :lang=>"en", + :metadata_extensions=>{"doctype"=>"standard", "editorialgroup"=>{"committee_type"=>"A", "committee"=>"TC"}}, + :obsoleteddate=>"XXX", + :publisheddate=>"XXX", + :publisher=>"Ribose", + :receiveddate=>"XXX", + :revdate=>"2000-01-01", + :revdate_monthyear=>"January 2000", + :roles_authors_affiliations=>{"editor"=>{""=>["Julius Caesar"]}, "full-author"=>{""=>["Fred Nerk"]}}, + :script=>"Latn", + :stage=>"Working Draft", + :stage_display=>"Working Draft", + :stageabbr=>"wd", + :tc=>"TC", + :transmitteddate=>"XXX", + :unchangeddate=>"XXX", + :unpublished=>true, + :updateddate=>"XXX", + :vote_endeddate=>"XXX", + :vote_starteddate=>"XXX"} + OUTPUT end it "processes pre" do @@ -204,12 +206,16 @@ OUTPUT - expect(xmlpp(IsoDoc::Csa::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml) - expect(xmlpp(IsoDoc::Csa::HtmlConvert.new({}).convert("test", presxml, true).gsub(/^.*.*}m, ""))).to be_equivalent_to xmlpp(html) + expect(xmlpp(IsoDoc::Csa::PresentationXMLConvert.new(presxml_options) + .convert("test", input, true))).to be_equivalent_to xmlpp(presxml) + expect(xmlpp(IsoDoc::Csa::HtmlConvert.new({}) + .convert("test", presxml, true) + .gsub(/^.*.*}m, ""))).to be_equivalent_to xmlpp(html) end it "processes section names" do - expect(xmlpp(IsoDoc::Csa::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT") + input = <<~INPUT @@ -276,6 +282,7 @@ INPUT + output = <<~OUTPUT @@ -340,6 +347,8 @@ OUTPUT + expect(xmlpp(IsoDoc::Csa::PresentationXMLConvert.new(presxml_options) + .convert("test", input, true))).to be_equivalent_to xmlpp(output) end it "injects JS into blank html" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6d82590..58406ef 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -29,6 +29,10 @@ def metadata(xml) end end +def presxml_options + { semanticxmlinsert: "false" } +end + def htmlencode(xml) HTMLEntities.new.encode(xml, :hexadecimal).gsub(/>/, ">").gsub(/ /, "\n") .gsub(/"/, '"').gsub(/</, "<").gsub(/&/, "&").gsub(/'/, "'")