isodoc 1.6.2 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4d6934377164c2124ffca74e9ac663f4761d9a2cd98724d3214282d92afd086
4
- data.tar.gz: b4ee6a1da7b45282dc01c025495b0071a3dcd382a5d76d31d4caeb299c3bf1f9
3
+ metadata.gz: b9d5c91b697c02cdac2a8221f2995d29f812804b48039967bd94c8aef7ce10c0
4
+ data.tar.gz: cf66a1f8d4eb41297360341e0da8d16a9ddf0af2679f072d758a259186a291bd
5
5
  SHA512:
6
- metadata.gz: f49d1f973ae0ee52d01c5d608057c04c44afe180427215a880158d13d322fb87fb0d8ee4d486dcdb35cf652645044194ac5bf322987fcbdc73aca3aae4966766
7
- data.tar.gz: 190b64f33fff0f3455ed7efbbb22f3f917b1249253f745ee61c9314a3638ad904cf005c8916c7734da7c962765e458d25ded2712bdf155d2f0a221d60ee7e789
6
+ metadata.gz: 4cfa5637d6c22e73dd2a6c5bc32841183691a5db4121102787fad3caddd61815541e7128b624f03d20bf00d1e94fed81e43aaa19d1b84260e7bde5cfc69d924e
7
+ data.tar.gz: 7015f57396172858edb4b8499e6c4706894ef540f6b96c95d5c9bf445580003a8e68d4930204e5731ec57dafa460c2cfbcf4da5572e82713070fd214bef5974e
data/Rakefile CHANGED
@@ -1,8 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
- require 'isodoc/gem_tasks'
3
+ require "isodoc/gem_tasks"
4
4
 
5
5
  IsoDoc::GemTasks.install
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
- task default: :spec
8
+ task default: :spec
@@ -4,7 +4,7 @@ module IsoDoc
4
4
  a = bibdata_current(docxml) or return
5
5
  bibdata_i18n(a)
6
6
  a.next =
7
- "<localized-strings>#{i8n_name(trim_hash(@i18n.get), "").join("")}"\
7
+ "<localized-strings>#{i8n_name(trim_hash(@i18n.get), '').join('')}"\
8
8
  "</localized-strings>"
9
9
  end
10
10
 
@@ -19,10 +19,10 @@ module IsoDoc
19
19
  a
20
20
  end
21
21
 
22
- def bibdata_i18n(b)
23
- hash_translate(b, @i18n.get["doctype_dict"], "./ext/doctype")
24
- hash_translate(b, @i18n.get["stage_dict"], "./status/stage")
25
- hash_translate(b, @i18n.get["substage_dict"], "./status/substage")
22
+ def bibdata_i18n(bib)
23
+ hash_translate(bib, @i18n.get["doctype_dict"], "./ext/doctype")
24
+ hash_translate(bib, @i18n.get["stage_dict"], "./status/stage")
25
+ hash_translate(bib, @i18n.get["substage_dict"], "./status/substage")
26
26
  end
27
27
 
28
28
  def hash_translate(bibdata, hash, xpath, lang = @lang)
@@ -46,8 +46,8 @@ module IsoDoc
46
46
  def i8n_name(h, pref)
47
47
  if h.is_a? Hash then i8n_name1(h, pref)
48
48
  elsif h.is_a? Array
49
- h.reject { |a| blank?(a) }.each_with_object([]).
50
- with_index do |(v1, g), i|
49
+ h.reject { |a| blank?(a) }.each_with_object([])
50
+ .with_index do |(v1, g), i|
51
51
  i8n_name(v1, "#{i18n_safe(k)}.#{i}").each { |x| g << x }
52
52
  end
53
53
  else [i18n_tag(pref, h)]
@@ -62,12 +62,12 @@ module IsoDoc
62
62
  i8n_name(v1, "#{i18n_safe(k)}.#{i}").each { |x| g << x }
63
63
  end
64
64
  else
65
- g << i18n_tag("#{pref}#{pref.empty? ? "" : "."}#{i18n_safe(k)}", v)
65
+ g << i18n_tag("#{pref}#{pref.empty? ? '' : '.'}#{i18n_safe(k)}", v)
66
66
  end
67
67
  end
68
68
  end
69
69
 
70
- #https://stackoverflow.com/a/31822406
70
+ # https://stackoverflow.com/a/31822406
71
71
  def blank?(v)
72
72
  v.nil? || v.respond_to?(:empty?) && v.empty?
73
73
  end
@@ -76,14 +76,17 @@ module IsoDoc
76
76
  loop do
77
77
  h_new = trim_hash1(h)
78
78
  break h if h==h_new
79
+
79
80
  h = h_new
80
81
  end
81
82
  end
82
83
 
83
84
  def trim_hash1(h)
84
85
  return h unless h.is_a? Hash
85
- h.each_with_object({}) do |(k,v), g|
86
+
87
+ h.each_with_object({}) do |(k, v), g|
86
88
  next if blank?(v)
89
+
87
90
  g[k] = if v.is_a? Hash then trim_hash1(h[k])
88
91
  elsif v.is_a? Array
89
92
  h[k].map { |a| trim_hash1(a) }.reject { |a| blank?(a) }
@@ -68,53 +68,53 @@ module IsoDoc
68
68
  # so not <origin bibitemid="ISO7301" citeas="ISO 7301">
69
69
  # <locality type="section"><reference>3.1</reference></locality></origin>
70
70
 
71
- def eref_localities(refs, target, n)
71
+ def eref_localities(refs, target, node)
72
72
  ret = ""
73
73
  refs.each_with_index do |r, i|
74
74
  delim = ","
75
75
  delim = ";" if r.name == "localityStack" && i.positive?
76
- ret = eref_locality_stack(r, i, target, delim, ret, n)
76
+ ret = eref_locality_stack(r, i, target, delim, ret, node)
77
77
  end
78
78
  ret
79
79
  end
80
80
 
81
- def eref_locality_stack(r, idx, target, delim, ret, n)
82
- if r.name == "localityStack"
83
- r.elements.each_with_index do |rr, j|
84
- ret += eref_localities0(rr, j, target, delim, n)
81
+ def eref_locality_stack(ref, idx, target, delim, ret, node)
82
+ if ref.name == "localityStack"
83
+ ref.elements.each_with_index do |rr, j|
84
+ ret += eref_localities0(rr, j, target, delim, node)
85
85
  delim = ","
86
86
  end
87
87
  else
88
- ret += eref_localities0(r, idx, target, delim, n)
88
+ ret += eref_localities0(ref, idx, target, delim, node)
89
89
  end
90
90
  ret
91
91
  end
92
92
 
93
- def eref_localities0(r, _i, target, delim, n)
94
- if r["type"] == "whole" then l10n("#{delim} #{@i18n.wholeoftext}")
93
+ def eref_localities0(ref, _i, target, delim, node)
94
+ if ref["type"] == "whole" then l10n("#{delim} #{@i18n.wholeoftext}")
95
95
  else
96
- eref_localities1(target, r["type"], r.at(ns("./referenceFrom")),
97
- r.at(ns("./referenceTo")), delim, n, @lang)
96
+ eref_localities1(target, ref["type"], ref.at(ns("./referenceFrom")),
97
+ ref.at(ns("./referenceTo")), delim, node, @lang)
98
98
  end
99
99
  end
100
100
 
101
101
  # TODO: move to localization file
102
- def eref_localities1_zh(_target, type, from, to, n, delim)
102
+ def eref_localities1_zh(_target, type, from, to, node, delim)
103
103
  ret = "#{delim} 第#{from.text}" if from
104
104
  ret += "&ndash;#{to.text}" if to
105
105
  loc = (@i18n.locality[type] || type.sub(/^locality:/, "").capitalize)
106
- ret += " #{loc}" unless n["droploc"] == "true"
106
+ ret += " #{loc}" unless node["droploc"] == "true"
107
107
  ret
108
108
  end
109
109
 
110
110
  # TODO: move to localization file
111
- def eref_localities1(target, type, from, to, delim, n, lang = "en")
111
+ def eref_localities1(target, type, from, to, delim, node, lang = "en")
112
112
  return "" if type == "anchor"
113
113
 
114
114
  lang == "zh" and
115
- return l10n(eref_localities1_zh(target, type, from, to, n, delim))
115
+ return l10n(eref_localities1_zh(target, type, from, to, node, delim))
116
116
  ret = delim
117
- ret += eref_locality_populate(type, n)
117
+ ret += eref_locality_populate(type, node)
118
118
  ret += " #{from.text}" if from
119
119
  ret += "&ndash;#{to.text}" if to
120
120
  l10n(ret)
@@ -158,12 +158,14 @@ module IsoDoc
158
158
  end
159
159
 
160
160
  def concept1(node)
161
- content = node.first_element_child.children.select do |c|
162
- !%w{locality localityStack}.include? c.name
161
+ content = node.first_element_child.children.reject do |c|
162
+ %w{locality localityStack}.include? c.name
163
163
  end.select { |c| !c.text? || /\S/.match(c) }
164
- node.replace content.empty? ?
165
- @i18n.term_defined_in.sub(/%/, node.first_element_child.to_xml) :
164
+ if node.replace content.empty?
165
+ @i18n.term_defined_in.sub(/%/, node.first_element_child.to_xml)
166
+ else
166
167
  "<em>#{node.children.to_xml}</em>"
168
+ end
167
169
  end
168
170
 
169
171
  def variant(docxml)
@@ -2,20 +2,21 @@ module IsoDoc
2
2
  class PresentationXMLConvert < ::IsoDoc::Convert
3
3
  def clause(docxml)
4
4
  docxml.xpath(ns("//clause | "\
5
- "//terms | //definitions | //references")).
6
- each do |f|
5
+ "//terms | //definitions | //references"))
6
+ .each do |f|
7
7
  clause1(f)
8
8
  end
9
9
  end
10
10
 
11
- def clause1(f)
12
- level = @xrefs.anchor(f['id'], :level, false) || "1"
13
- t = f.at(ns("./title")) and t["depth"] = level
14
- return if !f.ancestors("boilerplate").empty?
15
- return if @suppressheadingnumbers || f["unnumbered"]
16
- lbl = @xrefs.anchor(f['id'], :label,
17
- f.parent.name != "sections") or return
18
- prefix_name(f, "<tab/>", "#{lbl}#{clausedelim}", "title")
11
+ def clause1(elem)
12
+ level = @xrefs.anchor(elem["id"], :level, false) || "1"
13
+ t = elem.at(ns("./title")) and t["depth"] = level
14
+ return if !elem.ancestors("boilerplate").empty? ||
15
+ @suppressheadingnumbers || elem["unnumbered"]
16
+
17
+ lbl = @xrefs.anchor(elem["id"], :label,
18
+ elem.parent.name != "sections") or return
19
+ prefix_name(elem, "<tab/>", "#{lbl}#{clausedelim}", "title")
19
20
  end
20
21
 
21
22
  def annex(docxml)
@@ -24,12 +25,12 @@ module IsoDoc
24
25
  end
25
26
  end
26
27
 
27
- def annex1(f)
28
- lbl = @xrefs.anchor(f['id'], :label)
29
- if t = f.at(ns("./title"))
28
+ def annex1(elem)
29
+ lbl = @xrefs.anchor(elem["id"], :label)
30
+ if t = elem.at(ns("./title"))
30
31
  t.children = "<strong>#{t.children.to_xml}</strong>"
31
32
  end
32
- prefix_name(f, "<br/><br/>", lbl, "title")
33
+ prefix_name(elem, "<br/><br/>", lbl, "title")
33
34
  end
34
35
 
35
36
  def term(docxml)
@@ -38,18 +39,15 @@ module IsoDoc
38
39
  end
39
40
  end
40
41
 
41
- def term1(f)
42
- lbl = @xrefs.get[f["id"]][:label] or return
43
- prefix_name(f, "", "#{lbl}#{clausedelim}", "name")
42
+ def term1(elem)
43
+ lbl = @xrefs.get[elem["id"]][:label] or return
44
+ prefix_name(elem, "", "#{lbl}#{clausedelim}", "name")
44
45
  end
45
46
 
46
- def references(docxml)
47
- end
47
+ def references(docxml); end
48
48
 
49
49
  def index(docxml)
50
- docxml.xpath(ns("//index | //index-xref | //indexsect")).each do |f|
51
- f.remove
52
- end
50
+ docxml.xpath(ns("//index | //index-xref | //indexsect")).each(&:remove)
53
51
  end
54
52
  end
55
53
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'sassc'
3
+ require "sassc"
4
4
 
5
5
  class SasscImporter < SassC::Importer
6
6
  def imports(path, _parent_path)
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "1.6.2".freeze
2
+ VERSION = "1.6.3".freeze
3
3
  end
@@ -49,8 +49,7 @@ module IsoDoc::XrefGen
49
49
  @base = node["number"][0..-2]
50
50
  @letter = @letter_override = node["number"][-1]
51
51
  else
52
- @number_override = node["number"]
53
- @num = n.to_i
52
+ @number_override = @num = n.to_i
54
53
  @base = b
55
54
  @letter = ""
56
55
  end
@@ -10,7 +10,7 @@ module IsoDoc::XrefGen
10
10
  autonum = amend_autonums(a)
11
11
  NUMBERED_BLOCKS.each do |b|
12
12
  a.xpath(ns("./newcontent//#{b}")).each_with_index do |e, i|
13
- autonum[b] and i == 0 and e["number"] = autonum[b]
13
+ autonum[b] && i.zero? and e["number"] = autonum[b]
14
14
  !autonum[b] and e["unnumbered"] = "true"
15
15
  end
16
16
  end
@@ -29,6 +29,13 @@ module IsoDoc::XrefGen
29
29
  @labels["termnote"].gsub(/%/, note.to_s)
30
30
  end
31
31
 
32
+ def increment_label(elems, node, counter, increment = true)
33
+ return "" if elems.size == 1 && !node["number"]
34
+
35
+ counter.increment(node) if increment
36
+ " #{counter.print}"
37
+ end
38
+
32
39
  def termnote_anchor_names(docxml)
33
40
  docxml.xpath(ns("//term[descendant::termnote]")).each do |t|
34
41
  c = Counter.new
@@ -39,7 +46,7 @@ module IsoDoc::XrefGen
39
46
  @anchors[n["id"]] =
40
47
  { label: termnote_label(c.print), type: "termnote", value: c.print,
41
48
  xref: l10n("#{anchor(t['id'], :xref)}, "\
42
- "#{@labels["note_xref"]} #{c.print}") }
49
+ "#{@labels['note_xref']} #{c.print}") }
43
50
  end
44
51
  end
45
52
  end
@@ -52,11 +59,11 @@ module IsoDoc::XrefGen
52
59
  next if n["id"].nil? || n["id"].empty?
53
60
 
54
61
  c.increment(n)
55
- idx = examples.size == 1 && !n["number"] ? "" : c.print
62
+ idx = increment_label(examples, n, c, false)
56
63
  @anchors[n["id"]] = {
57
64
  type: "termexample", label: idx, value: c.print,
58
65
  xref: l10n("#{anchor(t['id'], :xref)}, "\
59
- "#{@labels["example_xref"]} #{c.print}") }
66
+ "#{@labels['example_xref']} #{c.print}") }
60
67
  end
61
68
  end
62
69
  end
@@ -84,9 +91,9 @@ module IsoDoc::XrefGen
84
91
  notes.each do |n|
85
92
  next if @anchors[n["id"]] || n["id"].nil? || n["id"].empty?
86
93
 
87
- idx = notes.size == 1 && !n["number"] ? "" : " #{c.increment(n).print}"
88
- @anchors[n["id"]] = anchor_struct(idx, n, @labels["note_xref"],
89
- "note", false)
94
+ @anchors[n["id"]] =
95
+ anchor_struct(increment_label(notes, n, c), n,
96
+ @labels["note_xref"], "note", false)
90
97
  end
91
98
  note_anchor_names(s.xpath(ns(CHILD_SECTIONS)))
92
99
  end
@@ -107,10 +114,9 @@ module IsoDoc::XrefGen
107
114
  notes.each do |n|
108
115
  next if @anchors[n["id"]] || n["id"].nil? || n["id"].empty?
109
116
 
110
- idx = notes.size == 1 && !n["number"] ? "" :
111
- " #{c.increment(n).print}"
112
- @anchors[n["id"]] = anchor_struct(idx, n, @labels["example_xref"],
113
- "example", n["unnumbered"])
117
+ @anchors[n["id"]] =
118
+ anchor_struct(increment_label(notes, n, c), n,
119
+ @labels["example_xref"], "example", n["unnumbered"])
114
120
  end
115
121
  example_anchor_names(s.xpath(ns(CHILD_SECTIONS)))
116
122
  end
@@ -124,9 +130,8 @@ module IsoDoc::XrefGen
124
130
  notes.each do |n|
125
131
  next if n["id"].nil? || n["id"].empty?
126
132
 
127
- idx = notes.size == 1 && !n["number"] ? "" : " #{c.increment(n).print}"
128
- @anchors[n["id"]] = anchor_struct(idx, n, @labels["list"], "list",
129
- false)
133
+ @anchors[n["id"]] = anchor_struct(increment_label(notes, n, c), n,
134
+ @labels["list"], "list", false)
130
135
  list_item_anchor_names(n, @anchors[n["id"]], 1, "", notes.size != 1)
131
136
  end
132
137
  list_anchor_names(s.xpath(ns(CHILD_SECTIONS)))
@@ -151,9 +156,11 @@ module IsoDoc::XrefGen
151
156
  def bookmark_anchor_names(docxml)
152
157
  docxml.xpath(ns(".//bookmark")).each do |n|
153
158
  next if n["id"].nil? || n["id"].empty?
159
+
154
160
  parent = nil
155
161
  n.ancestors.each do |a|
156
162
  next unless a["id"] && parent = @anchors.dig(a["id"], :xref)
163
+
157
164
  break
158
165
  end
159
166
  @anchors[n["id"]] = { type: "bookmark", label: nil, value: nil,
@@ -14,20 +14,20 @@ module IsoDoc::XrefGen
14
14
  end
15
15
  end
16
16
 
17
- def initial_anchor_names(d)
18
- d.xpath(ns("//preface/*")).each { |c| c.element? and preface_names(c) }
17
+ def initial_anchor_names(doc)
18
+ doc.xpath(ns("//preface/*")).each { |c| c.element? and preface_names(c) }
19
19
  # potentially overridden in middle_section_asset_names()
20
- sequential_asset_names(d.xpath(ns("//preface/*")))
20
+ sequential_asset_names(doc.xpath(ns("//preface/*")))
21
21
  n = Counter.new
22
- n = section_names(d.at(ns("//clause[@type = 'scope']")), n, 1)
23
- n = section_names(d.at(ns(@klass.norm_ref_xpath)), n, 1)
24
- n = section_names(d.at(ns("//sections/terms | "\
22
+ n = section_names(doc.at(ns("//clause[@type = 'scope']")), n, 1)
23
+ n = section_names(doc.at(ns(@klass.norm_ref_xpath)), n, 1)
24
+ n = section_names(doc.at(ns("//sections/terms | "\
25
25
  "//sections/clause[descendant::terms]")), n, 1)
26
- n = section_names(d.at(ns("//sections/definitions")), n, 1)
27
- clause_names(d, n)
28
- middle_section_asset_names(d)
29
- termnote_anchor_names(d)
30
- termexample_anchor_names(d)
26
+ n = section_names(doc.at(ns("//sections/definitions")), n, 1)
27
+ clause_names(doc, n)
28
+ middle_section_asset_names(doc)
29
+ termnote_anchor_names(doc)
30
+ termexample_anchor_names(doc)
31
31
  end
32
32
 
33
33
  def preface_clause_name(clause)
@@ -23,7 +23,7 @@ RSpec.describe IsoDoc do
23
23
  <title>Change Clause</title>
24
24
  <amend id='B' change='modify' path='//table[2]' path_end='//table[2]/following-sibling:example[1]' title='Change'>
25
25
  <autonumber type='table'>2</autonumber>
26
- <autonumber type='example'>7</autonumber>
26
+ <autonumber type='example'>A.7</autonumber>
27
27
  <description>
28
28
  <p id='C'>
29
29
  <em>
@@ -150,7 +150,7 @@ RSpec.describe IsoDoc do
150
150
  </tbody>
151
151
  </table>
152
152
  <figure id="H" unnumbered="true"><name>Figure</name></figure>
153
- <example id="F" number="7"><name>EXAMPLE 7</name>
153
+ <example id="F" number="A.7"><name>EXAMPLE A.7</name>
154
154
  <p id="G">This is not generalised further.</p>
155
155
  </example>
156
156
  </quote>
@@ -225,7 +225,7 @@ RSpec.describe IsoDoc do
225
225
  <p class='FigureTitle' style='text-align:center;'>Figure</p>
226
226
  </div>
227
227
  <div id='F' class='example'>
228
- <p class='example-title'>EXAMPLE 7</p>
228
+ <p class='example-title'>EXAMPLE A.7</p>
229
229
  <p id='G'>This is not generalised further.</p>
230
230
  </div>
231
231
  </div>
@@ -242,294 +242,233 @@ RSpec.describe IsoDoc do
242
242
  .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
243
243
  end
244
244
 
245
- it "processes unlabelled notes (Presentation XML)" do
245
+ it "processes unlabelled notes" do
246
+ input = <<~INPUT
247
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
248
+ <preface><foreword>
249
+ <note id="A" keep-with-next="true" keep-lines-together="true">
250
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
251
+ </note>
252
+ </foreword></preface>
253
+ </iso-standard>
254
+ INPUT
255
+ presxml = <<~OUTPUT
256
+ <?xml version='1.0'?>
257
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
258
+ <preface>
259
+ <foreword>
260
+ <note id='A' keep-with-next='true' keep-lines-together='true'>
261
+ <name>NOTE</name>
262
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
263
+ These results are based on a study carried out on three different
264
+ types of kernel.
265
+ </p>
266
+ </note>
267
+ </foreword>
268
+ </preface>
269
+ </iso-standard>
270
+ OUTPUT
271
+ html = <<~OUTPUT
272
+ #{HTML_HDR}
273
+ <br/>
274
+ <div>
275
+ <h1 class="ForewordTitle">Foreword</h1>
276
+ <div id="A" class="Note" style="page-break-after: avoid;page-break-inside: avoid;">
277
+ <p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
278
+ </div>
279
+ </div>
280
+ <p class="zzSTDTitle1"/>
281
+ </div>
282
+ </body>
283
+ </html>
284
+ OUTPUT
285
+ doc = <<~OUTPUT
286
+ <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
287
+ <head><style/></head>
288
+ <body lang="EN-US" link="blue" vlink="#954F72">
289
+ <div class="WordSection1">
290
+ <p>&#160;</p>
291
+ </div>
292
+ <p><br clear="all" class="section"/></p>
293
+ <div class="WordSection2">
294
+ <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
295
+ <div>
296
+ <h1 class="ForewordTitle">Foreword</h1>
297
+ <div id="A" class="Note" style='page-break-after: avoid;page-break-inside: avoid;'>
298
+ <p class="Note"><span class="note_label">NOTE</span><span style="mso-tab-count:1">&#160; </span>These results are based on a study carried out on three different types of kernel.</p>
299
+ </div>
300
+ </div>
301
+ <p>&#160;</p>
302
+ </div>
303
+ <p><br clear="all" class="section"/></p>
304
+ <div class="WordSection3">
305
+ <p class="zzSTDTitle1"/>
306
+ </div>
307
+ </body>
308
+ </html>
309
+ OUTPUT
246
310
  expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
247
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
248
- <iso-standard xmlns="http://riboseinc.com/isoxml">
249
- <preface><foreword>
250
- <note id="A" keep-with-next="true" keep-lines-together="true">
251
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
252
- </note>
253
- </foreword></preface>
254
- </iso-standard>
255
- INPUT
256
- <?xml version='1.0'?>
257
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
258
- <preface>
259
- <foreword>
260
- <note id='A' keep-with-next='true' keep-lines-together='true'>
261
- <name>NOTE</name>
262
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
263
- These results are based on a study carried out on three different
264
- types of kernel.
265
- </p>
266
- </note>
267
- </foreword>
268
- </preface>
269
- </iso-standard>
270
- OUTPUT
271
- end
272
-
273
- it "processes unlabelled notes (HTML)" do
311
+ .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
274
312
  expect(xmlpp(IsoDoc::HtmlConvert.new({})
275
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
276
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
277
- <preface>
278
- <foreword>
279
- <note id='A' keep-with-next='true' keep-lines-together='true'>
280
- <name>NOTE</name>
281
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
282
- These results are based on a study carried out on three different
283
- types of kernel.
284
- </p>
285
- </note>
286
- </foreword>
287
- </preface>
288
- </iso-standard>
289
- INPUT
290
- #{HTML_HDR}
291
- <br/>
292
- <div>
293
- <h1 class="ForewordTitle">Foreword</h1>
294
- <div id="A" class="Note" style="page-break-after: avoid;page-break-inside: avoid;">
295
- <p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
296
- </div>
297
- </div>
298
- <p class="zzSTDTitle1"/>
299
- </div>
300
- </body>
301
- </html>
302
- OUTPUT
303
- end
304
-
305
- it "processes unlabelled notes (Word)" do
313
+ .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
306
314
  expect(xmlpp(IsoDoc::WordConvert.new({})
307
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
308
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
309
- <preface>
310
- <foreword>
311
- <note id='A' keep-with-next='true' keep-lines-together='true'>
312
- <name>NOTE</name>
313
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
314
- These results are based on a study carried out on three different
315
- types of kernel.
316
- </p>
317
- </note>
318
- </foreword>
319
- </preface>
320
- </iso-standard>
321
- INPUT
322
- <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
323
- <head><style/></head>
324
- <body lang="EN-US" link="blue" vlink="#954F72">
325
- <div class="WordSection1">
326
- <p>&#160;</p>
327
- </div>
328
- <p><br clear="all" class="section"/></p>
329
- <div class="WordSection2">
330
- <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
331
- <div>
332
- <h1 class="ForewordTitle">Foreword</h1>
333
- <div id="A" class="Note" style='page-break-after: avoid;page-break-inside: avoid;'>
334
- <p class="Note"><span class="note_label">NOTE</span><span style="mso-tab-count:1">&#160; </span>These results are based on a study carried out on three different types of kernel.</p>
335
- </div>
336
- </div>
337
- <p>&#160;</p>
338
- </div>
339
- <p><br clear="all" class="section"/></p>
340
- <div class="WordSection3">
341
- <p class="zzSTDTitle1"/>
342
- </div>
343
- </body>
344
- </html>
345
- OUTPUT
315
+ .convert("test", presxml, true))).to be_equivalent_to xmlpp(doc)
346
316
  end
347
317
 
348
- it "processes sequences of notes (Presentation XML)" do
349
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
350
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
351
- <iso-standard xmlns="http://riboseinc.com/isoxml">
352
- <preface><foreword>
353
- <note id="note1">
354
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
355
- </note>
356
- <note id="note2">
357
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
358
- </note>
359
- </foreword></preface>
360
- </iso-standard>
361
- INPUT
362
- <?xml version='1.0'?>
363
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
364
- <preface>
365
- <foreword>
366
- <note id='note1'>
367
- <name>NOTE 1</name>
368
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
369
- These results are based on a study carried out on three different
370
- types of kernel.
371
- </p>
372
- </note>
373
- <note id='note2'>
374
- <name>NOTE 2</name>
375
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
376
- These results are based on a study carried out on three different
377
- types of kernel.
378
- </p>
379
- </note>
380
- </foreword>
381
- </preface>
382
- </iso-standard>
383
- OUTPUT
384
- end
318
+ it "processes sequences of notes" do
319
+ input = <<~INPUT
320
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
321
+ <preface><foreword>
322
+ <note id="note1">
323
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
324
+ </note>
325
+ <note id="note2">
326
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
327
+ </note>
328
+ </foreword></preface>
329
+ </iso-standard>
330
+ INPUT
331
+ presxml = <<~OUTPUT
332
+ <?xml version='1.0'?>
333
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
334
+ <preface>
335
+ <foreword>
336
+ <note id='note1'>
337
+ <name>NOTE 1</name>
338
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
339
+ These results are based on a study carried out on three different
340
+ types of kernel.
341
+ </p>
342
+ </note>
343
+ <note id='note2'>
344
+ <name>NOTE 2</name>
345
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
346
+ These results are based on a study carried out on three different
347
+ types of kernel.
348
+ </p>
349
+ </note>
350
+ </foreword>
351
+ </preface>
352
+ </iso-standard>
353
+ OUTPUT
385
354
 
386
- it "processes sequences of notes (HTML)" do
387
- expect(xmlpp(IsoDoc::HtmlConvert.new({})
388
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
389
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
390
- <preface>
391
- <foreword>
392
- <note id='note1'>
393
- <name>NOTE 1</name>
394
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
395
- These results are based on a study carried out on three different
396
- types of kernel.
397
- </p>
398
- </note>
399
- <note id='note2'>
400
- <name>NOTE 2</name>
401
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
402
- These results are based on a study carried out on three different
403
- types of kernel.
404
- </p>
405
- </note>
406
- </foreword>
407
- </preface>
408
- </iso-standard>
409
- INPUT
410
- #{HTML_HDR}
411
- <br/>
412
- <div>
413
- <h1 class="ForewordTitle">Foreword</h1>
414
- <div id="note1" class="Note">
415
- <p><span class="note_label">NOTE 1</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
416
- </div>
417
- <div id="note2" class="Note">
418
- <p><span class="note_label">NOTE 2</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
419
- </div>
355
+ output = <<~OUTPUT
356
+ #{HTML_HDR}
357
+ <br/>
358
+ <div>
359
+ <h1 class="ForewordTitle">Foreword</h1>
360
+ <div id="note1" class="Note">
361
+ <p><span class="note_label">NOTE 1</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
362
+ </div>
363
+ <div id="note2" class="Note">
364
+ <p><span class="note_label">NOTE 2</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
420
365
  </div>
421
- <p class="zzSTDTitle1"/>
422
366
  </div>
423
- </body>
424
- </html>
425
- OUTPUT
367
+ <p class="zzSTDTitle1"/>
368
+ </div>
369
+ </body>
370
+ </html>
371
+ OUTPUT
372
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
373
+ .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
374
+ expect(xmlpp(IsoDoc::HtmlConvert.new({})
375
+ .convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
426
376
  end
427
377
 
428
378
  it "processes multi-para notes" do
429
- expect(xmlpp(IsoDoc::HtmlConvert.new({})
430
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
431
- <iso-standard xmlns="http://riboseinc.com/isoxml">
432
- <preface><foreword>
433
- <note>
434
- <name>NOTE</name>
435
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
436
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
437
- </note>
438
- </foreword></preface>
439
- </iso-standard>
440
- INPUT
441
- #{HTML_HDR}
442
- <br/>
443
- <div>
444
- <h1 class="ForewordTitle">Foreword</h1>
445
- <div class="Note">
446
- <p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
447
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
448
- </div>
379
+ input = <<~INPUT
380
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
381
+ <preface><foreword>
382
+ <note>
383
+ <name>NOTE</name>
384
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
385
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
386
+ </note>
387
+ </foreword></preface>
388
+ </iso-standard>
389
+ INPUT
390
+ output = <<~OUTPUT
391
+ #{HTML_HDR}
392
+ <br/>
393
+ <div>
394
+ <h1 class="ForewordTitle">Foreword</h1>
395
+ <div class="Note">
396
+ <p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
397
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
449
398
  </div>
450
- <p class="zzSTDTitle1"/>
451
399
  </div>
452
- </body>
453
- </html>
454
- OUTPUT
455
- end
456
-
457
- it "processes non-para notes" do
400
+ <p class="zzSTDTitle1"/>
401
+ </div>
402
+ </body>
403
+ </html>
404
+ OUTPUT
458
405
  expect(xmlpp(IsoDoc::HtmlConvert.new({})
459
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
460
- <iso-standard xmlns="http://riboseinc.com/isoxml">
461
- <preface><foreword>
462
- <note id="A"><name>NOTE</name>
463
- <dl>
464
- <dt>A</dt>
465
- <dd><p>B</p></dd>
466
- </dl>
467
- <ul>
468
- <li>C</li></ul>
469
- </note>
470
- </foreword></preface>
471
- </iso-standard>
472
- INPUT
473
- #{HTML_HDR}
474
- <br/>
475
- <div>
476
- <h1 class="ForewordTitle">Foreword</h1>
477
- <div id="A" class="Note"><p><span class="note_label">NOTE</span>&#160; </p>
478
- <dl><dt><p>A</p></dt><dd><p>B</p></dd></dl>
479
- <ul>
480
- <li>C</li></ul>
481
- </div>
482
- </div>
483
- <p class="zzSTDTitle1"/>
484
- </div>
485
- </body>
486
- </html>
487
-
488
- OUTPUT
406
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
489
407
  end
490
408
 
491
- it "processes non-para notes (Word)" do
492
- expect(xmlpp(IsoDoc::WordConvert.new({})
493
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
494
- <iso-standard xmlns="http://riboseinc.com/isoxml">
495
- <preface><foreword>
496
- <note id="A"><name>NOTE</name>
497
- <dl>
498
- <dt>A</dt>
499
- <dd><p>B</p></dd>
500
- </dl>
501
- <ul>
502
- <li>C</li></ul>
503
- </note>
504
- </foreword></preface>
505
- </iso-standard>
506
- INPUT
507
- <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
508
- <head><style/></head>
509
- <body lang="EN-US" link="blue" vlink="#954F72">
510
- <div class="WordSection1">
511
- <p>&#160;</p>
512
- </div>
513
- <p><br clear="all" class="section"/></p>
514
- <div class="WordSection2">
515
- <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
516
- <div>
517
- <h1 class="ForewordTitle">Foreword</h1>
518
- <div id="A" class="Note"><p class="Note"><span class="note_label">NOTE</span><span style="mso-tab-count:1">&#160; </span></p>
519
- <table class="dl"><tr><td valign="top" align="left"><p align="left" style="margin-left:0pt;text-align:left;">A</p></td><td valign="top"><p class="Note">B</p></td></tr></table>
409
+ it "processes non-para notes" do
410
+ input = <<~INPUT
411
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
412
+ <preface><foreword>
413
+ <note id="A"><name>NOTE</name>
414
+ <dl>
415
+ <dt>A</dt>
416
+ <dd><p>B</p></dd>
417
+ </dl>
418
+ <ul>
419
+ <li>C</li></ul>
420
+ </note>
421
+ </foreword></preface>
422
+ </iso-standard>
423
+ INPUT
424
+ html = <<~OUTPUT
425
+ #{HTML_HDR}
426
+ <br/>
427
+ <div>
428
+ <h1 class="ForewordTitle">Foreword</h1>
429
+ <div id="A" class="Note"><p><span class="note_label">NOTE</span>&#160; </p>
430
+ <dl><dt><p>A</p></dt><dd><p>B</p></dd></dl>
520
431
  <ul>
521
432
  <li>C</li></ul>
522
433
  </div>
434
+ </div>
435
+ <p class="zzSTDTitle1"/>
523
436
  </div>
524
- <p>&#160;</p>
525
- </div>
526
- <p><br clear="all" class="section"/></p>
527
- <div class="WordSection3">
528
- <p class="zzSTDTitle1"/>
529
- </div>
530
- </body>
437
+ </body>
531
438
  </html>
439
+
532
440
  OUTPUT
441
+ doc = <<~OUTPUT
442
+ <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
443
+ <head><style/></head>
444
+ <body lang="EN-US" link="blue" vlink="#954F72">
445
+ <div class="WordSection1">
446
+ <p>&#160;</p>
447
+ </div>
448
+ <p><br clear="all" class="section"/></p>
449
+ <div class="WordSection2">
450
+ <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
451
+ <div>
452
+ <h1 class="ForewordTitle">Foreword</h1>
453
+ <div id="A" class="Note"><p class="Note"><span class="note_label">NOTE</span><span style="mso-tab-count:1">&#160; </span></p>
454
+ <table class="dl"><tr><td valign="top" align="left"><p align="left" style="margin-left:0pt;text-align:left;">A</p></td><td valign="top"><p class="Note">B</p></td></tr></table>
455
+ <ul>
456
+ <li>C</li></ul>
457
+ </div>
458
+ </div>
459
+ <p>&#160;</p>
460
+ </div>
461
+ <p><br clear="all" class="section"/></p>
462
+ <div class="WordSection3">
463
+ <p class="zzSTDTitle1"/>
464
+ </div>
465
+ </body>
466
+ </html>
467
+ OUTPUT
468
+ expect(xmlpp(IsoDoc::HtmlConvert.new({})
469
+ .convert("test", input, true))).to be_equivalent_to xmlpp(html)
470
+ expect(xmlpp(IsoDoc::WordConvert.new({})
471
+ .convert("test", input, true))).to be_equivalent_to xmlpp(doc)
533
472
  end
534
473
 
535
474
  it "processes paragraphs containing notes" do
@@ -896,41 +835,41 @@ RSpec.describe IsoDoc do
896
835
  </foreword></preface>
897
836
  </iso-standard>
898
837
  INPUT
899
- <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
900
- <head>
901
- <style>
902
- </style>
903
- </head>
904
- <body lang='EN-US' link='blue' vlink='#954F72'>
905
- <div class='WordSection1'>
906
- <p>&#160;</p>
907
- </div>
908
- <p>
909
- <br clear='all' class='section'/>
910
- </p>
911
- <div class='WordSection2'>
912
- <p>
913
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
914
- </p>
915
- <div>
916
- <h1 class='ForewordTitle'>Foreword</h1>
917
- <div id='figureA-1' class='figure'>
918
- <img src='spec/assets/odf.emf'/>
919
- <img src='spec/assets/odf1.emf'/>
920
- <img src='_.emf' height='auto' width='auto'/>
921
- <img src='_.xml' height='20' width='auto'/>
922
- </div>
923
- </div>
924
- <p>&#160;</p>
925
- </div>
926
- <p>
927
- <br clear='all' class='section'/>
928
- </p>
929
- <div class='WordSection3'>
930
- <p class='zzSTDTitle1'/>
931
- </div>
932
- </body>
933
- </html>
838
+ <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
839
+ <head>
840
+ <style>
841
+ </style>
842
+ </head>
843
+ <body lang='EN-US' link='blue' vlink='#954F72'>
844
+ <div class='WordSection1'>
845
+ <p>&#160;</p>
846
+ </div>
847
+ <p>
848
+ <br clear='all' class='section'/>
849
+ </p>
850
+ <div class='WordSection2'>
851
+ <p>
852
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
853
+ </p>
854
+ <div>
855
+ <h1 class='ForewordTitle'>Foreword</h1>
856
+ <div id='figureA-1' class='figure'>
857
+ <img src='spec/assets/odf.emf'/>
858
+ <img src='spec/assets/odf1.emf'/>
859
+ <img src='_.emf' height='auto' width='auto'/>
860
+ <img src='_.xml' height='20' width='auto'/>
861
+ </div>
862
+ </div>
863
+ <p>&#160;</p>
864
+ </div>
865
+ <p>
866
+ <br clear='all' class='section'/>
867
+ </p>
868
+ <div class='WordSection3'>
869
+ <p class='zzSTDTitle1'/>
870
+ </div>
871
+ </body>
872
+ </html>
934
873
  OUTPUT
935
874
  end
936
875
 
@@ -944,50 +883,50 @@ RSpec.describe IsoDoc do
944
883
 
945
884
  expect(xmlpp(strip_guid(IsoDoc::WordConvert.new({})
946
885
  .convert("test", <<~"INPUT", true).gsub(/['"][^'".]+(?<!odf1)(?<!odf)\.svg['"]/, "'_.svg'").gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref")))).to be_equivalent_to xmlpp(<<~"OUTPUT")
947
- <iso-standard xmlns="http://riboseinc.com/isoxml">
948
- <preface><foreword>
949
- <figure id="figureA-1">
950
- <image src="spec/assets/odf.svg" mimetype="image/svg+xml"/>
951
- <image src="spec/assets/odf1.svg" mimetype="image/svg+xml"/>
952
- <image src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICA8Y2lyY2xlIGZpbGw9IiMwMDkiIHI9IjQ1IiBjeD0iNTAiIGN5PSI1MCIvPgogIDxwYXRoIGQ9Ik0zMywyNkg3OEEzNywzNywwLDAsMSwzMyw4M1Y1N0g1OVY0M0gzM1oiIGZpbGw9IiNGRkYiLz4KPC9zdmc+Cg==" id="_d3731866-1a07-435a-a6c2-1acd41023a4e" mimetype="image/svg+xml" height="auto" width="auto"/>
953
- </figure>
954
- </foreword></preface>
955
- </iso-standard>
886
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
887
+ <preface><foreword>
888
+ <figure id="figureA-1">
889
+ <image src="spec/assets/odf.svg" mimetype="image/svg+xml"/>
890
+ <image src="spec/assets/odf1.svg" mimetype="image/svg+xml"/>
891
+ <image src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICA8Y2lyY2xlIGZpbGw9IiMwMDkiIHI9IjQ1IiBjeD0iNTAiIGN5PSI1MCIvPgogIDxwYXRoIGQ9Ik0zMywyNkg3OEEzNywzNywwLDAsMSwzMyw4M1Y1N0g1OVY0M0gzM1oiIGZpbGw9IiNGRkYiLz4KPC9zdmc+Cg==" id="_d3731866-1a07-435a-a6c2-1acd41023a4e" mimetype="image/svg+xml" height="auto" width="auto"/>
892
+ </figure>
893
+ </foreword></preface>
894
+ </iso-standard>
956
895
  INPUT
957
- <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
958
- <head>
959
- <style>
960
- </style>
961
- </head>
962
- <body lang='EN-US' link='blue' vlink='#954F72'>
963
- <div class='WordSection1'>
964
- <p>&#160;</p>
965
- </div>
966
- <p>
967
- <br clear='all' class='section'/>
968
- </p>
969
- <div class='WordSection2'>
970
- <p>
971
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
972
- </p>
973
- <div>
974
- <h1 class='ForewordTitle'>Foreword</h1>
975
- <div id='figureA-1' class='figure'>
976
- <img src='spec/assets/odf.emf'/>
977
- <img src='spec/assets/odf1.svg'/>
978
- <img src='_.svg' height='auto' width='auto'/>
979
- </div>
980
- </div>
981
- <p>&#160;</p>
982
- </div>
983
- <p>
984
- <br clear='all' class='section'/>
985
- </p>
986
- <div class='WordSection3'>
987
- <p class='zzSTDTitle1'/>
988
- </div>
989
- </body>
990
- </html>
896
+ <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
897
+ <head>
898
+ <style>
899
+ </style>
900
+ </head>
901
+ <body lang='EN-US' link='blue' vlink='#954F72'>
902
+ <div class='WordSection1'>
903
+ <p>&#160;</p>
904
+ </div>
905
+ <p>
906
+ <br clear='all' class='section'/>
907
+ </p>
908
+ <div class='WordSection2'>
909
+ <p>
910
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
911
+ </p>
912
+ <div>
913
+ <h1 class='ForewordTitle'>Foreword</h1>
914
+ <div id='figureA-1' class='figure'>
915
+ <img src='spec/assets/odf.emf'/>
916
+ <img src='spec/assets/odf1.svg'/>
917
+ <img src='_.svg' height='auto' width='auto'/>
918
+ </div>
919
+ </div>
920
+ <p>&#160;</p>
921
+ </div>
922
+ <p>
923
+ <br clear='all' class='section'/>
924
+ </p>
925
+ <div class='WordSection3'>
926
+ <p class='zzSTDTitle1'/>
927
+ </div>
928
+ </body>
929
+ </html>
991
930
  OUTPUT
992
931
  end
993
932
  end
@@ -1639,15 +1578,15 @@ RSpec.describe IsoDoc do
1639
1578
 
1640
1579
  it "processes blockquotes (Presentation XML)" do
1641
1580
  expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1642
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1643
- <preface><foreword>
1644
- <quote id="_044bd364-c832-4b78-8fea-92242402a1d1">
1645
- <source type="inline" bibitemid="ISO7301" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>1</referenceFrom></locality></source>
1646
- <author>ISO</author>
1647
- <p id="_d4fd0a61-f300-4285-abe6-602707590e53">This International Standard gives the minimum specifications for rice (<em>Oryza sativa</em> L.) which is subject to international trade. It is applicable to the following types: husked rice and milled rice, parboiled or not, intended for direct human consumption. It is neither applicable to other products derived from rice, nor to waxy rice (glutinous rice).</p>
1648
- </quote>
1649
- </foreword></preface>
1650
- </iso-standard>
1581
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1582
+ <preface><foreword>
1583
+ <quote id="_044bd364-c832-4b78-8fea-92242402a1d1">
1584
+ <source type="inline" bibitemid="ISO7301" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>1</referenceFrom></locality></source>
1585
+ <author>ISO</author>
1586
+ <p id="_d4fd0a61-f300-4285-abe6-602707590e53">This International Standard gives the minimum specifications for rice (<em>Oryza sativa</em> L.) which is subject to international trade. It is applicable to the following types: husked rice and milled rice, parboiled or not, intended for direct human consumption. It is neither applicable to other products derived from rice, nor to waxy rice (glutinous rice).</p>
1587
+ </quote>
1588
+ </foreword></preface>
1589
+ </iso-standard>
1651
1590
  INPUT
1652
1591
  <?xml version='1.0'?>
1653
1592
  <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
@@ -1678,15 +1617,15 @@ RSpec.describe IsoDoc do
1678
1617
 
1679
1618
  it "processes blockquotes (HTML)" do
1680
1619
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1681
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1682
- <preface><foreword>
1683
- <quote id="_044bd364-c832-4b78-8fea-92242402a1d1">
1684
- <source type="inline" bibitemid="ISO7301" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 7301:2011, Clause 1</source>
1685
- <author>ISO</author>
1686
- <p id="_d4fd0a61-f300-4285-abe6-602707590e53">This International Standard gives the minimum specifications for rice (<em>Oryza sativa</em> L.) which is subject to international trade. It is applicable to the following types: husked rice and milled rice, parboiled or not, intended for direct human consumption. It is neither applicable to other products derived from rice, nor to waxy rice (glutinous rice).</p>
1687
- </quote>
1688
- </foreword></preface>
1689
- </iso-standard>
1620
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1621
+ <preface><foreword>
1622
+ <quote id="_044bd364-c832-4b78-8fea-92242402a1d1">
1623
+ <source type="inline" bibitemid="ISO7301" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 7301:2011, Clause 1</source>
1624
+ <author>ISO</author>
1625
+ <p id="_d4fd0a61-f300-4285-abe6-602707590e53">This International Standard gives the minimum specifications for rice (<em>Oryza sativa</em> L.) which is subject to international trade. It is applicable to the following types: husked rice and milled rice, parboiled or not, intended for direct human consumption. It is neither applicable to other products derived from rice, nor to waxy rice (glutinous rice).</p>
1626
+ </quote>
1627
+ </foreword></preface>
1628
+ </iso-standard>
1690
1629
  INPUT
1691
1630
  #{HTML_HDR}
1692
1631
  <br/>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-10 00:00:00.000000000 Z
11
+ date: 2021-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath