or equivalent
def designation_field(desgn, name)
if desgn.name == "preferred"
f = desgn.xpath(ns("./../domain | ./../subject")).map(&:remove)
@@ -235,11 +241,20 @@ def merge_second_preferred(term)
pref << " (#{tail})"
end
+ def termnote_delim(_elem)
+ "—"
+ end
+
def termnote1(elem)
- lbl = l10n(@xrefs.anchor(elem["id"], :label)&.strip || "???")
+ lbl = termnote_label(elem)
prefix_name(elem, block_delim, lower2cap(lbl), "name")
end
+ def termnote_label(elem)
+ lbl = l10n(@xrefs.anchor(elem["id"], :label)&.strip || "???")
+ l10n "#{lbl}#{termnote_delim(elem)}"
+ end
+
def term(docxml); end
def concept1(node)
diff --git a/lib/isodoc/ieee/presentation_xml_convert.rb b/lib/isodoc/ieee/presentation_xml_convert.rb
index 6574e58..b22b528 100644
--- a/lib/isodoc/ieee/presentation_xml_convert.rb
+++ b/lib/isodoc/ieee/presentation_xml_convert.rb
@@ -18,8 +18,9 @@ def eref_localities_conflated(refs, target, node)
ret = resolve_eref_connectives(eref_locality_stacks(refs, target,
node))
node["droploc"] = droploc
+ p = prefix_clause(target, refs.first.at(ns("./locality")))
eref_localities1({ target: target, number: "pl",
- type: prefix_clause(target, refs.first.at(ns("./locality"))),
+ type: p,
from: l10n(ret[1..-1].join), node: node,
lang: @lang })
end
@@ -72,13 +73,8 @@ def block_delim
"—"
end
- def note1(elem)
- elem.parent.name == "bibitem" || elem["notag"] == "true" and return
- n = @xrefs.get[elem["id"]]
- lbl = if n.nil? || n[:label].nil? || n[:label].empty? then @i18n.note
- else l10n("#{@i18n.note} #{n[:label]}")
- end
- prefix_name(elem, block_delim, lbl, "name")
+ def note_delim(_elem)
+ "—"
end
def annex1(elem)
@@ -95,7 +91,7 @@ def annex1_whitepaper(elem)
t.name = "variant-title"
t["type"] = "sub"
end
- elem.children.first.previous = "#{lbl}"
+ elem.add_first_child "#{lbl}"
end
def annex1_default(elem)
diff --git a/lib/isodoc/ieee/word_authority.rb b/lib/isodoc/ieee/word_authority.rb
index 213f36c..d457f0c 100644
--- a/lib/isodoc/ieee/word_authority.rb
+++ b/lib/isodoc/ieee/word_authority.rb
@@ -153,9 +153,9 @@ def feedback_style(docxml)
def feedback_style1(div, idx)
div.xpath(".//p").each_with_index do |p, j|
p["class"] = idx == 4 ? "IEEEStdsCRTextItal" : "IEEEStdsCRTextReg"
- j.zero? && idx.zero? and
- p.children.first.previous =
- ''
+ j.zero? && idx.zero? and p.add_first_child <<~XML
+
+ XML
end
end
@@ -203,9 +203,9 @@ def abstract_cleanup1(source, dest)
end
def abstract_header(dest)
- dest.elements.first.children.first.previous =
- " "
+ dest.elements.first.add_first_child <<~XML
+
+ XML
end
def introduction_cleanup(docxml)
diff --git a/lib/isodoc/ieee/word_convert.rb b/lib/isodoc/ieee/word_convert.rb
index d66b18c..576c112 100644
--- a/lib/isodoc/ieee/word_convert.rb
+++ b/lib/isodoc/ieee/word_convert.rb
@@ -191,7 +191,6 @@ def termnote_parse(node, out)
def termnote_label(para, name)
para.span class: "note_label" do |s|
name.children.each { |n| parse(n, s) }
- s << termnote_delim
end
end
diff --git a/lib/isodoc/ieee/word_wp_convert.rb b/lib/isodoc/ieee/word_wp_convert.rb
index bf56b6b..ba12609 100644
--- a/lib/isodoc/ieee/word_wp_convert.rb
+++ b/lib/isodoc/ieee/word_wp_convert.rb
@@ -100,7 +100,6 @@ def figure_parse1(node, out)
out.div **figure_attrs(node) do |div|
figure_name_parse(node, div, node.at(ns("./name")))
node.children.each do |n|
- figure_key(out) if n.name == "dl"
parse(n, div) unless n.name == "name"
end
end
diff --git a/spec/isodoc/blocks_spec.rb b/spec/isodoc/blocks_spec.rb
index 9448c1d..5719b5f 100644
--- a/spec/isodoc/blocks_spec.rb
+++ b/spec/isodoc/blocks_spec.rb
@@ -63,7 +63,7 @@
Contents
-
+ Foreword
Table 1—Hello
@@ -127,7 +127,7 @@
A type of rice
- NOTE
+ NOTE—
This is a table about rice
@@ -383,34 +383,53 @@
INPUT
presxml = <<~OUTPUT
-
Contents
-
-
-
-
-
-
+ Foreword
+
+
+
+
+
+
OUTPUT
html = <<~OUTPUT
#{HTML_HDR}
@@ -420,85 +439,117 @@
-
+
-
-
-
-