From 454ebe2a3df896f35098351a8eb3d130ac131413 Mon Sep 17 00:00:00 2001 From: Nick Nicholas Date: Wed, 29 Nov 2023 01:59:59 +1100 Subject: [PATCH] allow recursive container prefixes for cross-references: https://github.com/metanorma/metanorma-jis/issues/126 --- lib/isodoc/ieee/xref.rb | 4 ++-- spec/isodoc/section_spec.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/isodoc/ieee/xref.rb b/lib/isodoc/ieee/xref.rb index 741d016..6d12d69 100644 --- a/lib/isodoc/ieee/xref.rb +++ b/lib/isodoc/ieee/xref.rb @@ -61,11 +61,11 @@ def middle_section_asset_names(doc) end end - def sequential_formula_names(clause) + def sequential_formula_names(clause, container: false) c = Counter.new clause.xpath(ns(".//formula")).noblank.each do |t| @anchors[t["id"]] = anchor_struct( - c.increment(t).print, nil, + c.increment(t).print, container ? t : nil, t["inequality"] ? @labels["inequality"] : @labels["formula"], "formula", t["unnumbered"] ) diff --git a/spec/isodoc/section_spec.rb b/spec/isodoc/section_spec.rb index dbe1cf4..8677050 100644 --- a/spec/isodoc/section_spec.rb +++ b/spec/isodoc/section_spec.rb @@ -898,7 +898,7 @@ OUTPUT html = <<~OUTPUT
-

Participants

+

Participants

At the time this draft Standard was completed, the Working Group had the @@ -1136,8 +1136,8 @@ .to be_equivalent_to xmlpp(presxml) IsoDoc::IEEE::HtmlConvert.new({}).convert("test", presxml, false) expect(File.exist?("test.html")).to be true - expect(xmlpp(Nokogiri::XML(File.read("test.html")) - .at("//div[@id = 'boilerplate-participants']").to_xml)) + expect(strip_guid(xmlpp(Nokogiri::XML(File.read("test.html")) + .at("//div[@id = 'boilerplate-participants']").to_xml))) .to be_equivalent_to xmlpp(html) IsoDoc::IEEE::WordConvert.new({}).convert("test", presxml, false) expect(File.exist?("test.doc")).to be true