diff --git a/Gemfile.devel b/Gemfile.devel
new file mode 100644
index 0000000..22972db
--- /dev/null
+++ b/Gemfile.devel
@@ -0,0 +1,4 @@
+gem "isodoc", git: "https://github.com/metanorma/isodoc", branch: "feature/presxml-autonum"
+gem "isodoc-i18n", git: "https://github.com/metanorma/isodoc-i18n", branch: "fix/markup-connectives"
+gem "mn-requirements", git: "https://github.com/metanorma/mn-requirements", branch: "feature/presxml-autonum"
+
diff --git a/lib/isodoc/ietf/blocks.rb b/lib/isodoc/ietf/blocks.rb
index 09e28f0..f2fb5aa 100644
--- a/lib/isodoc/ietf/blocks.rb
+++ b/lib/isodoc/ietf/blocks.rb
@@ -166,9 +166,11 @@ def formula_where(dlist, out)
def formula_parse1(node, out)
out.t **attr_code(anchor: node["id"]) do |p|
parse(node.at(ns("./stem")), p)
- lbl = @xrefs.anchor(node["id"], :label, false)
- lbl.nil? or
- p << " (#{lbl})"
+ if lbl = @xrefs.anchor(node["id"], :label, false)
+ lbl.gsub!(%r{?span[^>]*>}, "")
+ /^\(.+?\)$/.match?(lbl) or lbl = "(#{lbl})"
+ p << " #{lbl}"
+ end
end
end
diff --git a/lib/isodoc/ietf/inline.rb b/lib/isodoc/ietf/inline.rb
index c252bae..50059e0 100644
--- a/lib/isodoc/ietf/inline.rb
+++ b/lib/isodoc/ietf/inline.rb
@@ -138,7 +138,8 @@ def eref_parse(node, out)
section: eref_section(node),
relative: eref_relative(node),
sectionFormat: node["displayFormat"]) do |l|
- linkend.each { |n| parse(n, l) }
+ linkend.map(&:text).join.strip.empty? or
+ linkend.each { |n| parse(n, l) }
end
end
@@ -148,10 +149,11 @@ def eref_relative(node)
end
def eref_section(node)
- @isodoc.eref_localities(
+ ret = @isodoc.eref_localities(
node.xpath(ns("./locality | ./localityStack")), nil, node
- )&.sub(/^,/, "")&.sub(/^\s*(Sections?|Clauses?)/, "")&.strip
- &.sub(/,$/, "") || ""
+ ) or return ""
+ ret.gsub(%r{?span[^>]*>}, "").sub(/^,/, "")
+ .sub(/^\s*(Sections?|Clauses?)/, "").strip.sub(/,$/, "")
end
def origin_parse(node, out)
@@ -171,6 +173,10 @@ def index_parse(node, out)
def bookmark_parse(node, out)
out.bookmark nil, **attr_code(anchor: node["id"])
end
+
+ def span_parse(node, out)
+ children_parse(node, out)
+ end
end
end
end
diff --git a/lib/isodoc/ietf/reqt.rb b/lib/isodoc/ietf/reqt.rb
index 737348d..cd843ee 100644
--- a/lib/isodoc/ietf/reqt.rb
+++ b/lib/isodoc/ietf/reqt.rb
@@ -12,9 +12,9 @@ def recommendation_parse(node, out)
end
def recommendation_parse1(node, out)
- recommendation_name(node.at(ns("./name")), out)
+ recommendation_name(node.at(ns("./fmt-name")), out)
node.children.each do |n|
- parse(n, out) unless n.name == "name"
+ parse(n, out) unless n.name == "fmt-name"
end
end
diff --git a/lib/isodoc/ietf/xref.rb b/lib/isodoc/ietf/xref.rb
index 4179599..2b2e410 100644
--- a/lib/isodoc/ietf/xref.rb
+++ b/lib/isodoc/ietf/xref.rb
@@ -7,12 +7,11 @@ def termnote_anchor_names(docxml)
docxml.xpath(ns("//term[descendant::termnote]")).each do |t|
c = IsoDoc::XrefGen::Counter.new
notes = t.xpath(ns("./termnote"))
- notes.each do |n|
- next if n["id"].nil? || n["id"].empty?
-
+ notes.noblank.each do |n|
idx = notes.size == 1 ? "" : " #{c.increment(n).print}"
@anchors[n["id"]] =
- anchor_struct(idx, n, @labels["note_xref"], "note", false)
+ anchor_struct(idx, n, @labels["note_xref"], "note",
+ { container: true })
end
end
end
diff --git a/spec/isodoc/blocks_spec.rb b/spec/isodoc/blocks_spec.rb
index be13ebb..95a72fb 100644
--- a/spec/isodoc/blocks_spec.rb
+++ b/spec/isodoc/blocks_spec.rb
@@ -517,11 +517,9 @@