isodoc 1.6.2 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +2 -2
- data/lib/isodoc/presentation_function/bibdata.rb +13 -10
- data/lib/isodoc/presentation_function/inline.rb +22 -20
- data/lib/isodoc/presentation_function/section.rb +20 -22
- data/lib/isodoc/sassc_importer.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/xref/xref_counter.rb +1 -2
- data/lib/isodoc/xref/xref_gen.rb +21 -14
- data/lib/isodoc/xref/xref_sect_gen.rb +11 -11
- data/spec/isodoc/blocks_spec.rb +304 -365
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9d5c91b697c02cdac2a8221f2995d29f812804b48039967bd94c8aef7ce10c0
|
4
|
+
data.tar.gz: cf66a1f8d4eb41297360341e0da8d16a9ddf0af2679f072d758a259186a291bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cfa5637d6c22e73dd2a6c5bc32841183691a5db4121102787fad3caddd61815541e7128b624f03d20bf00d1e94fed81e43aaa19d1b84260e7bde5cfc69d924e
|
7
|
+
data.tar.gz: 7015f57396172858edb4b8499e6c4706894ef540f6b96c95d5c9bf445580003a8e68d4930204e5731ec57dafa460c2cfbcf4da5572e82713070fd214bef5974e
|
data/Rakefile
CHANGED
@@ -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),
|
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(
|
23
|
-
hash_translate(
|
24
|
-
hash_translate(
|
25
|
-
hash_translate(
|
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? ?
|
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
|
-
|
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,
|
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,
|
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(
|
82
|
-
if
|
83
|
-
|
84
|
-
ret += eref_localities0(rr, j, target, delim,
|
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(
|
88
|
+
ret += eref_localities0(ref, idx, target, delim, node)
|
89
89
|
end
|
90
90
|
ret
|
91
91
|
end
|
92
92
|
|
93
|
-
def eref_localities0(
|
94
|
-
if
|
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,
|
97
|
-
|
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,
|
102
|
+
def eref_localities1_zh(_target, type, from, to, node, delim)
|
103
103
|
ret = "#{delim} 第#{from.text}" if from
|
104
104
|
ret += "–#{to.text}" if to
|
105
105
|
loc = (@i18n.locality[type] || type.sub(/^locality:/, "").capitalize)
|
106
|
-
ret += " #{loc}" unless
|
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,
|
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,
|
115
|
+
return l10n(eref_localities1_zh(target, type, from, to, node, delim))
|
116
116
|
ret = delim
|
117
|
-
ret += eref_locality_populate(type,
|
117
|
+
ret += eref_locality_populate(type, node)
|
118
118
|
ret += " #{from.text}" if from
|
119
119
|
ret += "–#{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.
|
162
|
-
|
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
|
-
|
5
|
+
"//terms | //definitions | //references"))
|
6
|
+
.each do |f|
|
7
7
|
clause1(f)
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
def clause1(
|
12
|
-
level = @xrefs.anchor(
|
13
|
-
t =
|
14
|
-
return if !
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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(
|
28
|
-
lbl = @xrefs.anchor(
|
29
|
-
if t =
|
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(
|
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(
|
42
|
-
lbl = @xrefs.get[
|
43
|
-
prefix_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
|
51
|
-
f.remove
|
52
|
-
end
|
50
|
+
docxml.xpath(ns("//index | //index-xref | //indexsect")).each(&:remove)
|
53
51
|
end
|
54
52
|
end
|
55
53
|
end
|
data/lib/isodoc/version.rb
CHANGED
data/lib/isodoc/xref/xref_gen.rb
CHANGED
@@ -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]
|
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[
|
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
|
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[
|
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
|
-
|
88
|
-
|
89
|
-
|
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
|
-
|
111
|
-
|
112
|
-
|
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
|
-
|
128
|
-
|
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(
|
18
|
-
|
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(
|
20
|
+
sequential_asset_names(doc.xpath(ns("//preface/*")))
|
21
21
|
n = Counter.new
|
22
|
-
n = section_names(
|
23
|
-
n = section_names(
|
24
|
-
n = section_names(
|
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(
|
27
|
-
clause_names(
|
28
|
-
middle_section_asset_names(
|
29
|
-
termnote_anchor_names(
|
30
|
-
termexample_anchor_names(
|
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)
|
data/spec/isodoc/blocks_spec.rb
CHANGED
@@ -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
|
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>  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> </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">  </span>These results are based on a study carried out on three different types of kernel.</p>
|
299
|
+
</div>
|
300
|
+
</div>
|
301
|
+
<p> </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",
|
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",
|
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>  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",
|
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> </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">  </span>These results are based on a study carried out on three different types of kernel.</p>
|
335
|
-
</div>
|
336
|
-
</div>
|
337
|
-
<p> </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
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
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
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
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>  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>  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>  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>  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
|
-
|
424
|
-
|
425
|
-
|
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
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
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>  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
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
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",
|
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>  </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
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
</
|
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">  </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>  </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
|
-
|
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> </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">  </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> </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
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
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> </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> </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
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
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
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
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> </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> </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
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
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
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
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.
|
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-
|
11
|
+
date: 2021-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciimath
|