isodoc 0.8.1 → 0.8.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: d6d2dab4cea8fcb1ace19dc45b56bd22e2760d90e95ace97fa1baccfb9b202fa
4
- data.tar.gz: be7c14b98bb593ebcf3e268f0f4b01e4537d3ffb1df91f079bca644ba9540653
3
+ metadata.gz: 0321e7f3851982b8a41f0b4ad71cb942c8e559121780f3089bc3954ea06438d4
4
+ data.tar.gz: 5f86453bbf454a1d430a31b8cfaa5bab753b19b7117e5fec70ae34b15dad419b
5
5
  SHA512:
6
- metadata.gz: de177f5b8d07b4e34cb0c35059017bc14d15d6079893a811f6a2f6faa6fc3cb350fd3a9bdc1f93edba8466e0695081eb4da4a376c126bec52bad61934f285ed8
7
- data.tar.gz: 66a28cfc65f4d953469a6676515dc532aec51c0a06d971281e9eecc1c1c7fa769b3f635e3ec657d7f07db620ba9bf32d53169b6e6de88a02c54bec629db28fd2
6
+ metadata.gz: '01875c7a9de4657a22eec95a6a9a613e1f227ab5d345015d8ff83478cb03019a5dec57fea43e8c08e114fd05ac3597e285c1d0cdf757d6a51a71a73ab8e6522d'
7
+ data.tar.gz: a7160ab90056650b4e72ab7df23549442f9938ec1a3c9b96cb8ef32b6b700fa4dd6c30edadb380bf85d3e131b0ddb4871c2e005c5b135cdbc3435bd19eea5725
data/.travis.yml ADDED
@@ -0,0 +1,13 @@
1
+ sudo: false
2
+ language: ruby
3
+
4
+ rvm:
5
+ - 2.5
6
+ - 2.4
7
+ - ruby-head
8
+
9
+ before_install: gem install bundler -v 1.16.2
10
+
11
+ matrix:
12
+ allow_failures:
13
+ - rvm: ruby-head
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  GIT
2
2
  remote: https://github.com/riboseinc/html2doc.git
3
- revision: ae15cfc0a4c8ebeb74193a8aa4a7884938a08434
3
+ revision: e9c0077be0c3d36bb09fa35743a79b00dd5ac560
4
4
  specs:
5
- html2doc (0.8.0)
5
+ html2doc (0.8.1)
6
6
  asciimath
7
7
  htmlentities (~> 4.3.4)
8
8
  image_size
@@ -15,13 +15,11 @@ GIT
15
15
  PATH
16
16
  remote: .
17
17
  specs:
18
- isodoc (0.8)
18
+ isodoc (0.8.3)
19
19
  asciimath
20
- html2doc (>= 0.7.1)
20
+ html2doc (~> 0.8.1)
21
21
  htmlentities (~> 4.3.4)
22
- image_size
23
22
  liquid
24
- mime-types
25
23
  nokogiri
26
24
  roman-numerals
27
25
  ruby-xslt
@@ -72,13 +70,13 @@ GEM
72
70
  mime-types-data (3.2016.0521)
73
71
  mini_portile2 (2.3.0)
74
72
  nenv (0.3.0)
75
- nokogiri (1.8.3)
73
+ nokogiri (1.8.4)
76
74
  mini_portile2 (~> 2.3.0)
77
75
  notiffany (0.1.1)
78
76
  nenv (~> 0.1)
79
77
  shellany (~> 0.0)
80
78
  parallel (1.12.1)
81
- parser (2.5.1.0)
79
+ parser (2.5.1.2)
82
80
  ast (~> 2.4.0)
83
81
  powerpack (0.1.2)
84
82
  pry (0.11.3)
@@ -103,10 +101,10 @@ GEM
103
101
  diff-lcs (>= 1.2.0, < 2.0)
104
102
  rspec-support (~> 3.7.0)
105
103
  rspec-support (3.7.1)
106
- rubocop (0.57.2)
104
+ rubocop (0.58.1)
107
105
  jaro_winkler (~> 1.5.1)
108
106
  parallel (~> 1.10)
109
- parser (>= 2.5)
107
+ parser (>= 2.5, != 2.5.1.1)
110
108
  powerpack (~> 0.1)
111
109
  rainbow (>= 2.2.2, < 4.0)
112
110
  ruby-progressbar (~> 1.7)
data/isodoc.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  DESCRIPTION
21
21
 
22
22
  spec.homepage = "https://github.com/riboseinc/isodoc"
23
- spec.license = "MIT"
23
+ spec.license = "BSD-2-Clause"
24
24
 
25
25
  spec.bindir = "bin"
26
26
  spec.require_paths = ["lib"]
@@ -30,13 +30,11 @@ Gem::Specification.new do |spec|
30
30
 
31
31
  spec.add_dependency "asciimath"
32
32
  spec.add_dependency "htmlentities", "~> 4.3.4"
33
- spec.add_dependency "image_size"
34
- spec.add_dependency "mime-types"
35
33
  spec.add_dependency "nokogiri"
36
34
  spec.add_dependency "ruby-xslt"
37
35
  spec.add_dependency "thread_safe"
38
36
  spec.add_dependency "uuidtools"
39
- spec.add_dependency "html2doc", ">= 0.7.1"
37
+ spec.add_dependency "html2doc", "~> 0.8.1"
40
38
  spec.add_dependency "liquid"
41
39
  spec.add_dependency "roman-numerals"
42
40
  spec.add_dependency "sass"
@@ -12,7 +12,7 @@ table_of_contents: 目次
12
12
  introduction: 引言
13
13
  foreword: 前言
14
14
  termsdef: 术语和定义
15
- termsdefsymbols_lbl: 术语、定义、符号、代号和缩略语
15
+ termsdefsymbols: 术语、定义、符号、代号和缩略语
16
16
  normref: 规范性引用文件
17
17
  bibliography: 参考文献
18
18
  clause: 条
@@ -95,6 +95,7 @@ module IsoDoc
95
95
  result = convert1(docxml, filename, dir)
96
96
  return result if debug
97
97
  postprocess(result, filename, dir)
98
+ system "rm -fr #{dir}"
98
99
  end
99
100
  end
100
101
  end
@@ -9,7 +9,7 @@ module IsoDoc::Function
9
9
  end
10
10
 
11
11
  def note_p_parse(node, div)
12
- div.p **{ class: "Note" } do |p|
12
+ div.p do |p|
13
13
  p.span **{ class: "note_label" } do |s|
14
14
  s << note_label(node)
15
15
  end
@@ -20,7 +20,7 @@ module IsoDoc::Function
20
20
  end
21
21
 
22
22
  def note_parse1(node, div)
23
- div.p **{ class: "Note" } do |p|
23
+ div.p do |p|
24
24
  p.span **{ class: "note_label" } do |s|
25
25
  s << note_label(node)
26
26
  end
@@ -155,7 +155,6 @@ module IsoDoc::Function
155
155
 
156
156
  def para_attrs(node)
157
157
  classtype = nil
158
- classtype = "Note" if @note
159
158
  classtype = "MsoCommentText" if in_comment
160
159
  classtype = "Sourcecode" if @annotation
161
160
  attrs = { class: classtype, id: node["id"] }
@@ -204,8 +203,11 @@ module IsoDoc::Function
204
203
  end
205
204
  end
206
205
 
207
- def image_parse(url, out, caption)
208
- out.img **attr_code(src: url)
206
+ def image_parse(node, out, caption)
207
+ attrs = { src: node["src"],
208
+ height: node["height"] || "auto",
209
+ width: node["width"] || "auto" }
210
+ out.img **attr_code(attrs)
209
211
  image_title_parse(out, caption)
210
212
  end
211
213
  end
@@ -143,11 +143,6 @@ module IsoDoc::Function
143
143
  d.parent = insert_here
144
144
  end
145
145
  end
146
- # preempt html2doc putting MsoNormal there
147
- docxml.xpath("//p[not(self::*[@class])]"\
148
- "[ancestor::*[@class = 'Note']]").each do |p|
149
- p["class"] = "Note"
150
- end
151
146
  end
152
147
 
153
148
  def table_cleanup(docxml)
@@ -11,7 +11,13 @@ module IsoDoc::Function
11
11
  def link_parse(node, out)
12
12
  linktext = node.text
13
13
  linktext = node["target"] if linktext.empty?
14
- out.a(**{ "href": node["target"] }) { |l| l << linktext }
14
+ out.a(**{ "href": node["target"] }) do |l|
15
+ if node.text.empty?
16
+ l << linktext
17
+ else
18
+ node.children.each { |n| parse(n, l) }
19
+ end
20
+ end
15
21
  end
16
22
 
17
23
  def callout_parse(node, out)
@@ -50,7 +50,8 @@ module IsoDoc::Function
50
50
 
51
51
  def dt_parse(dt, term)
52
52
  if dt.elements.empty?
53
- term.p **attr_code(class: note? ? "Note" : nil) do |p|
53
+ #term.p **attr_code(class: note? ? "Note" : nil) do |p|
54
+ term.p do |p|
54
55
  p << dt.text
55
56
  end
56
57
  else
@@ -73,7 +73,7 @@ module IsoDoc::Function
73
73
 
74
74
  # TODO generate formatted ref if not present
75
75
  def noniso_bibitem(list, b, ordinal, bibliography)
76
- list.p **attr_code("id": b["id"], class: "Biblio") do |r|
76
+ list.p **attr_code(iso_bibitem_entry_attrs(b, bibliography)) do |r|
77
77
  if bibliography
78
78
  id = docid_l10n(b.at(ns("./docidentifier")).text.gsub(/[\[\]]/, ""))
79
79
  ref_entry_code(r, ordinal, id)
@@ -125,7 +125,7 @@ module IsoDoc::Function
125
125
  end
126
126
 
127
127
  def terms_defs_title(f)
128
- symbols = f.at(".//definitions")
128
+ symbols = f.at(ns(".//definitions"))
129
129
  return @termsdefsymbols_lbl if symbols
130
130
  @termsdef_lbl
131
131
  end
@@ -42,7 +42,7 @@ module IsoDoc::Function
42
42
  def termnote_parse(node, out)
43
43
  out.div **{ class: "Note" } do |div|
44
44
  first = node.first_element_child
45
- div.p **{ class: "Note" } do |p|
45
+ div.p do |p|
46
46
  p << "#{get_anchors[node['id']][:label]}: "
47
47
  para_then_remainder(first, node, p, div)
48
48
  end
@@ -157,7 +157,7 @@ module IsoDoc::Function
157
157
  when "table" then table_parse(node, out)
158
158
  when "figure" then figure_parse(node, out)
159
159
  when "example" then example_parse(node, out)
160
- when "image" then image_parse(node["src"], out, nil)
160
+ when "image" then image_parse(node, out, nil)
161
161
  when "sourcecode" then sourcecode_parse(node, out)
162
162
  when "annotation" then annotation_parse(node, out)
163
163
  when "term" then termdef_parse(node, out)
@@ -194,37 +194,18 @@ module IsoDoc::HtmlFunction
194
194
  matched = /\.(?<suffix>\S+)$/.match i["src"]
195
195
  uuid = UUIDTools::UUID.random_create.to_s
196
196
  new_full_filename = File.join("_images", "#{uuid}.#{matched[:suffix]}")
197
- system "cp #{i['src']} #{new_full_filename}"
198
- i["src"] = new_full_filename
199
- i["width"], i["height"] = Html2Doc.image_resize(i, 800, 1200)
197
+ move_image1(i, new_full_filename)
200
198
  end
201
199
  docxml
202
200
  end
203
201
 
204
- #def html_toc1(h, ret, prevname)
205
- #h["id"] = UUIDTools::UUID.random_create.to_s unless h["id"]
206
- #li = "<li><a href='##{h["id"]}'>#{header_strip(h)}</a></li>"
207
- #if h.name == "h1"
208
- #ret += "</ul>" if prevname == "h2"
209
- #else
210
- #ret += "<ul>" if prevname == "h1"
211
- #end
212
- #ret + li
213
- #end
214
- #
215
- #def html_toc_obsolete(docxml)
216
- #return docxml unless @htmlintropage
217
- #ret = ""
218
- #prevname = ""
219
- #docxml.xpath("//h1 | //h2").each do |h|
220
- #next if ["toc-contents", "TermNum"].include? h["class"]
221
- #ret = html_toc1(h, ret, prevname)
222
- #prevname = h.name
223
- #end
224
- #ret += "<ul>" if prevname == "h2"
225
- #docxml.at("//*[@id='toc-list']").replace("<ul>#{ret}</ret>")
226
- #docxml
227
- #end
202
+ def move_image1(i, new_full_filename)
203
+ system "cp #{i['src']} #{new_full_filename}"
204
+ i["src"] = new_full_filename
205
+ if i["width"] != "auto" && i["height"] != "auto"
206
+ i["width"], i["height"] = Html2Doc.image_resize(i, 800, 1200)
207
+ end
208
+ end
228
209
 
229
210
  def html_toc(docxml)
230
211
  docxml
@@ -32,6 +32,23 @@ p.Biblio, li.Biblio, div.Biblio
32
32
  mso-fareast-font-family:$bodyfont;
33
33
  mso-bidi-font-family:$bodyfont;
34
34
  mso-ansi-language:EN-GB;}
35
+ p.NormRef, li.NormRef, div.NormRef
36
+ {mso-style-unhide:no;
37
+ mso-style-qformat:yes;
38
+ mso-style-parent:"";
39
+ margin-top:0cm;
40
+ margin-right:0cm;
41
+ margin-bottom:12.0pt;
42
+ margin-left:0pt;
43
+ text-indent:0pt;
44
+ tab-stops: 33.15pt;
45
+ line-height:12.0pt;
46
+ mso-pagination:widow-orphan;
47
+ font-size:11.0pt;
48
+ font-family:$bodyfont;
49
+ mso-fareast-font-family:$bodyfont;
50
+ mso-bidi-font-family:$bodyfont;
51
+ mso-ansi-language:EN-GB;}
35
52
  p.FigureTitle
36
53
  {mso-style-unhide:no;
37
54
  mso-style-qformat:yes;
@@ -91,7 +91,7 @@ dd {
91
91
  grid-column-start: 2;
92
92
  }
93
93
 
94
- dd p {
94
+ dd p, dt p {
95
95
  margin-top: 0px;
96
96
  }
97
97
 
@@ -590,7 +590,7 @@ ul, ol {margin-left: 2em;}
590
590
  3.5 Bibliograhy
591
591
  */
592
592
 
593
- p.Biblio {
593
+ p.Biblio, p.NormRef {
594
594
  margin-top: 1em;
595
595
  margin-left: 2em;
596
596
  }
@@ -86,7 +86,7 @@ dd {
86
86
  grid-column-start: 2;
87
87
  }
88
88
 
89
- dd p {
89
+ dd p, dt p {
90
90
  margin-top: 0px;
91
91
  }
92
92
 
@@ -574,7 +574,7 @@ ul, ol {margin-left: 2em;}
574
574
  3.5 Bibliograhy
575
575
  */
576
576
 
577
- p.Biblio {
577
+ p.Biblio, p.NormRef {
578
578
  margin-top: 1em;
579
579
  margin-left: 2em;
580
580
  }
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "0.8.1".freeze
2
+ VERSION = "0.8.3".freeze
3
3
  end
@@ -145,5 +145,61 @@ module IsoDoc::WordFunction
145
145
  a.parent = dd
146
146
  end
147
147
  end
148
+
149
+ def note_p_parse(node, div)
150
+ div.p **{ class: "Note" } do |p|
151
+ p.span **{ class: "note_label" } do |s|
152
+ s << note_label(node)
153
+ end
154
+ insert_tab(p, 1)
155
+ node.first_element_child.children.each { |n| parse(n, p) }
156
+ end
157
+ node.element_children[1..-1].each { |n| parse(n, div) }
158
+ end
159
+
160
+ def note_parse1(node, div)
161
+ div.p **{ class: "Note" } do |p|
162
+ p.span **{ class: "note_label" } do |s|
163
+ s << note_label(node)
164
+ end
165
+ insert_tab(p, 1)
166
+ end
167
+ node.children.each { |n| parse(n, div) }
168
+ end
169
+
170
+ def termnote_parse(node, out)
171
+ out.div **{ class: "Note" } do |div|
172
+ first = node.first_element_child
173
+ div.p **{ class: "Note" } do |p|
174
+ p << "#{get_anchors[node['id']][:label]}: "
175
+ para_then_remainder(first, node, p, div)
176
+ end
177
+ end
178
+ end
179
+
180
+ def para_attrs(node)
181
+ classtype = nil
182
+ classtype = "Note" if @note
183
+ classtype = "MsoCommentText" if in_comment
184
+ classtype = "Sourcecode" if @annotation
185
+ attrs = { class: classtype, id: node["id"] }
186
+ unless node["align"].nil?
187
+ attrs[:align] = node["align"] unless node["align"] == "justify"
188
+ attrs[:style] = "text-align:#{node['align']}"
189
+ end
190
+ attrs
191
+ end
192
+
193
+ def image_parse(node, out, caption)
194
+ attrs = { src: node["src"],
195
+ height: node["height"],
196
+ width: node["width"] }
197
+ if node["height"] == "auto" || node["width"] == "auto"
198
+ attrs[:height] = nil
199
+ attrs[:width] = nil
200
+ end
201
+ out.img **attr_code(attrs)
202
+ image_title_parse(out, caption)
203
+ end
148
204
  end
149
205
  end
@@ -1,5 +1,13 @@
1
1
  module IsoDoc::WordFunction
2
2
  module Postprocess
3
+ def table_note_cleanup(docxml)
4
+ super
5
+ # preempt html2doc putting MsoNormal there
6
+ docxml.xpath("//p[not(self::*[@class])]"\
7
+ "[ancestor::*[@class = 'Note']]").each do |p|
8
+ p["class"] = "Note"
9
+ end
10
+ end
3
11
 
4
12
  def postprocess(result, filename, dir)
5
13
  header = generate_header(filename, dir)
@@ -16,7 +16,7 @@ RSpec.describe IsoDoc do
16
16
  <div>
17
17
  <h1 class="ForewordTitle">Foreword</h1>
18
18
  <div id="" class="Note">
19
- <p class="Note"><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
19
+ <p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
20
20
  </div>
21
21
  </div>
22
22
  <p class="zzSTDTitle1"/>
@@ -26,6 +26,45 @@ RSpec.describe IsoDoc do
26
26
  OUTPUT
27
27
  end
28
28
 
29
+ it "processes unlabelled notes (Word)" do
30
+ expect(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
31
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
32
+ <preface><foreword>
33
+ <note>
34
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
35
+ </note>
36
+ </foreword></preface>
37
+ </iso-standard>
38
+ INPUT
39
+ <html xmlns:epub="http://www.idpf.org/2007/ops">
40
+ <head>
41
+ <title>test</title>
42
+ </head>
43
+ <body lang="EN-US" link="blue" vlink="#954F72">
44
+ <div class="WordSection1">
45
+ <p>&#160;</p>
46
+ </div>
47
+ <br clear="all" class="section"/>
48
+ <div class="WordSection2">
49
+ <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
50
+ <div>
51
+ <h1 class="ForewordTitle">Foreword</h1>
52
+ <div id="" class="Note">
53
+ <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>
54
+ </div>
55
+ </div>
56
+ <p>&#160;</p>
57
+ </div>
58
+ <br clear="all" class="section"/>
59
+ <div class="WordSection3">
60
+ <p class="zzSTDTitle1"/>
61
+ </div>
62
+ </body>
63
+ </html>
64
+ OUTPUT
65
+ end
66
+
67
+
29
68
  it "processes labelled notes" do
30
69
  expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
31
70
  <iso-standard xmlns="http://riboseinc.com/isoxml">
@@ -41,7 +80,7 @@ INPUT
41
80
  <div>
42
81
  <h1 class="ForewordTitle">Foreword</h1>
43
82
  <div id="note1" class="Note">
44
- <p class="Note"><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
83
+ <p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
45
84
  </div>
46
85
  </div>
47
86
  <p class="zzSTDTitle1"/>
@@ -69,10 +108,10 @@ INPUT
69
108
  <div>
70
109
  <h1 class="ForewordTitle">Foreword</h1>
71
110
  <div id="note1" class="Note">
72
- <p class="Note"><span class="note_label">NOTE 1</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
111
+ <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>
73
112
  </div>
74
113
  <div id="note2" class="Note">
75
- <p class="Note"><span class="note_label">NOTE 2</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
114
+ <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>
76
115
  </div>
77
116
  </div>
78
117
  <p class="zzSTDTitle1"/>
@@ -98,8 +137,8 @@ INPUT
98
137
  <div>
99
138
  <h1 class="ForewordTitle">Foreword</h1>
100
139
  <div id="" class="Note">
101
- <p class="Note"><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
102
- <p class="Note" id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
140
+ <p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
141
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
103
142
  </div>
104
143
  </div>
105
144
  <p class="zzSTDTitle1"/>
@@ -128,8 +167,8 @@ INPUT
128
167
  <br/>
129
168
  <div>
130
169
  <h1 class="ForewordTitle">Foreword</h1>
131
- <div id="" class="Note"><p class="Note"><span class="note_label">NOTE</span>&#160; </p>
132
- <dl><dt><p class="Note">A</p></dt><dd><p class="Note">B</p></dd></dl>
170
+ <div id="" class="Note"><p><span class="note_label">NOTE</span>&#160; </p>
171
+ <dl><dt><p>A</p></dt><dd><p>B</p></dd></dl>
133
172
  <ul>
134
173
  <li>C</li></ul>
135
174
  </div>
@@ -142,13 +181,59 @@ INPUT
142
181
  OUTPUT
143
182
  end
144
183
 
184
+ it "processes non-para notes (Word)" do
185
+ expect(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
186
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
187
+ <preface><foreword>
188
+ <note>
189
+ <dl>
190
+ <dt>A</dt>
191
+ <dd><p>B</p></dd>
192
+ </dl>
193
+ <ul>
194
+ <li>C</li></ul>
195
+ </note>
196
+ </foreword></preface>
197
+ </iso-standard>
198
+ INPUT
199
+ <html xmlns:epub="http://www.idpf.org/2007/ops">
200
+ <head>
201
+ <title>test</title>
202
+ </head>
203
+ <body lang="EN-US" link="blue" vlink="#954F72">
204
+ <div class="WordSection1">
205
+ <p>&#160;</p>
206
+ </div>
207
+ <br clear="all" class="section"/>
208
+ <div class="WordSection2">
209
+ <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
210
+ <div>
211
+ <h1 class="ForewordTitle">Foreword</h1>
212
+ <div id="" class="Note"><p class="Note"><span class="note_label">NOTE</span><span style="mso-tab-count:1">&#160; </span></p>
213
+ <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>
214
+ <ul>
215
+ <li>C</li></ul>
216
+ </div>
217
+ </div>
218
+ <p>&#160;</p>
219
+ </div>
220
+ <br clear="all" class="section"/>
221
+ <div class="WordSection3">
222
+ <p class="zzSTDTitle1"/>
223
+ </div>
224
+ </body>
225
+ </html>
226
+ OUTPUT
227
+ end
228
+
145
229
  it "processes figures" do
146
230
  expect(strip_guid(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to <<~"OUTPUT"
147
231
  <iso-standard xmlns="http://riboseinc.com/isoxml">
148
232
  <preface><foreword>
149
233
  <figure id="figureA-1">
150
234
  <name>Split-it-right sample divider</name>
151
- <image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/>
235
+ <image src="rice_images/rice_image1.png" height="20" width="30" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/>
236
+ <image src="rice_images/rice_image1.png" height="20" width="auto" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/>
152
237
  <fn reference="a">
153
238
  <p id="_ef2c85b8-5a5a-4ecd-a1e6-92acefaaa852">The time <stem type="AsciiMath">t_90</stem> was estimated to be 18,2 min for this example.</p>
154
239
  </fn>
@@ -166,7 +251,8 @@ INPUT
166
251
  <h1 class="ForewordTitle">Foreword</h1>
167
252
  <div id="figureA-1" class="figure">
168
253
 
169
- <img src="rice_images/rice_image1.png"/>
254
+ <img src="rice_images/rice_image1.png" height="20" width="30"/>
255
+ <img src="rice_images/rice_image1.png" height="20" width="auto"/>
170
256
  <a href="#_" class="TableFootnoteRef">a</a><aside class="footnote"><div id="fn:_"><a id="_" class="TableFootnoteRef">a&#160; </a>
171
257
  <p id="_">The time <span class="stem">(#(t_90)#)</span> was estimated to be 18,2 min for this example.</p>
172
258
  </div></aside>
@@ -186,7 +272,8 @@ INPUT
186
272
  <preface><foreword>
187
273
  <figure id="figureA-1">
188
274
  <name>Split-it-right sample divider</name>
189
- <image src="rice_images/rice_image1.png" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/>
275
+ <image src="rice_images/rice_image1.png" height="20" width="30" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/>
276
+ <image src="rice_images/rice_image1.png" height="20" width="auto" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" imagetype="PNG"/>
190
277
  <fn reference="a">
191
278
  <p id="_ef2c85b8-5a5a-4ecd-a1e6-92acefaaa852">The time <stem type="AsciiMath">t_90</stem> was estimated to be 18,2 min for this example.</p>
192
279
  </fn>
@@ -213,6 +300,7 @@ INPUT
213
300
  <h1 class="ForewordTitle">Foreword</h1>
214
301
  <div id="figureA-1" class="figure">
215
302
 
303
+ <img src="rice_images/rice_image1.png" height="20" width="30"/>
216
304
  <img src="rice_images/rice_image1.png"/>
217
305
  <a href="#_" class="TableFootnoteRef">a</a><aside><div id="ftn_"><a id="_" class="TableFootnoteRef">a<span style="mso-tab-count:1">&#160; </span></a>
218
306
  <p id="_">The time <span class="stem">(#(t_90)#)</span> was estimated to be 18,2 min for this example.</p>
@@ -95,7 +95,7 @@ RSpec.describe IsoDoc do
95
95
  <h1>2.&#160; Normative references</h1>
96
96
  <p>There are no normative references in this document.</p>
97
97
  </div>
98
- <div id="H"><h1>3.&#160; Terms and definitions</h1><p>For the purposes of this document,
98
+ <div id="H"><h1>3.&#160; Terms, definitions, symbols and abbreviated terms</h1><p>For the purposes of this document,
99
99
  the following terms and definitions apply.</p>
100
100
  <p>ISO and IEC maintain terminological databases for use in
101
101
  standardization at the following addresses:</p>
@@ -252,7 +252,7 @@ RSpec.describe IsoDoc do
252
252
  <h1>2.&#160; Normative references</h1>
253
253
  <p>There are no normative references in this document.</p>
254
254
  </div>
255
- <div id="H"><h1>3.&#160; Terms and definitions</h1><p>For the purposes of this document,
255
+ <div id="H"><h1>3.&#160; Terms, definitions, symbols and abbreviated terms</h1><p>For the purposes of this document,
256
256
  the following terms and definitions apply.</p>
257
257
  <p>ISO and IEC maintain terminological databases for use in
258
258
  standardization at the following addresses:</p>
@@ -409,7 +409,7 @@ RSpec.describe IsoDoc do
409
409
  <h1>2.&#160; R&#233;f&#233;rences normatives</h1>
410
410
  <p>Le pr&#233;sent document ne contient aucune r&#233;f&#233;rence normative.</p>
411
411
  </div>
412
- <div id="H"><h1>3.&#160; Terms et d&#233;finitions</h1><p>Pour les besoins du pr&#233;sent document, les termes et d&#233;finitions suivants s'appliquent.</p>
412
+ <div id="H"><h1>3.&#160; Terms, d&#233;finitions, symboles et termes abr&#233;g&#233;s</h1><p>Pour les besoins du pr&#233;sent document, les termes et d&#233;finitions suivants s'appliquent.</p>
413
413
  <p>L'ISO et l'IEC tiennent &#224; jour des bases de donn&#233;es terminologiques
414
414
  destin&#233;es &#224; &#234;tre utilis&#233;es en normalisation, consultables aux adresses
415
415
  suivantes:</p>
@@ -579,7 +579,7 @@ RSpec.describe IsoDoc do
579
579
  <p>&#19979;&#21015;&#25991;&#20214;&#23545;&#20110;&#26412;&#25991;&#20214;&#30340;&#24212;&#29992;&#26159;&#24517;&#19981;&#21487;&#23569;&#30340;&#12290; &#20961;&#26159;&#27880;&#26085;&#26399;&#30340;&#24341;&#29992;&#25991;&#20214;&#65292;&#20165;&#27880;&#26085;&#26399;&#30340;&#29256;&#26412;&#36866;&#29992;&#20110;&#26412;&#25991;&#20214;&#12290; &#20961;&#26159;&#19981;&#27880;&#26085;&#26399;&#30340;&#24341;&#29992;&#25991;&#20214;&#65292;&#20854;&#26368;&#26032;&#29256;&#26412;&#65288;&#21253;&#25324;&#25152;&#26377;&#30340;&#20462;&#25913;&#21333;&#65289;&#36866;&#29992;&#20110;&#26412;&#25991;&#20214;&#12290;</p>
580
580
  <p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products</i></p>
581
581
  </div>
582
- <div id="H"><h1>3.&#160; &#26415;&#35821;&#21644;&#23450;&#20041;</h1><p>&#19979;&#21015;&#26415;&#35821;&#21644;&#23450;&#20041;&#36866;&#29992;&#20110;&#26412;&#25991;&#20214;&#12290;</p>
582
+ <div id="H"><h1>3.&#160; &#26415;&#35821;&#12289;&#23450;&#20041;&#12289;&#31526;&#21495;&#12289;&#20195;&#21495;&#21644;&#32553;&#30053;&#35821;</h1><p>&#19979;&#21015;&#26415;&#35821;&#21644;&#23450;&#20041;&#36866;&#29992;&#20110;&#26412;&#25991;&#20214;&#12290;</p>
583
583
  <p>ISO&#21644;IEC&#29992;&#20110;&#26631;&#20934;&#21270;&#30340;&#26415;&#35821;&#25968;&#25454;&#24211;&#22320;&#22336;&#22914;&#19979;&#65306;</p>
584
584
  <ul>
585
585
  <li> <p>ISO&#22312;&#32447;&#27983;&#35272;&#24179;&#21488;:
@@ -165,7 +165,7 @@ RSpec.describe IsoDoc do
165
165
  </dd>
166
166
  </dl>
167
167
  <div id="" class="Note">
168
- <p class="Note"><span class="note_label">NOTE</span>&#160; This is a note</p>
168
+ <p><span class="note_label">NOTE</span>&#160; This is a note</p>
169
169
  </div>
170
170
  </div>
171
171
  <p class="zzSTDTitle1"/>
@@ -409,6 +409,8 @@ CkZJTEVOQU1FOiB0ZXN0Cgo=
409
409
  <figure id="_">
410
410
  <name>Split-it-right sample divider</name>
411
411
  <image src="spec/assets/rice_image1.png" id="_" imagetype="PNG"/>
412
+ <image src="spec/assets/rice_image1.png" id="_" width="20000" height="300000" imagetype="PNG"/>
413
+ <image src="spec/assets/rice_image1.png" id="_" width="99" height="auto" imagetype="PNG"/>
412
414
  </figure>
413
415
  </foreword></preface>
414
416
  </iso-standard>
@@ -423,7 +425,10 @@ CkZJTEVOQU1FOiB0ZXN0Cgo=
423
425
  <h1 class="ForewordTitle">Foreword</h1>
424
426
  <div id="_" class="figure">
425
427
 
426
- <img src="_images/_.png" width="800" height="673" />
428
+ <img src="_images/_.png" height="auto" width="auto" />
429
+ <img src="_images/_.png" height="1200" width="80" />
430
+ <img src="_images/_.png" height="auto" width="99" />
431
+
427
432
  <p class="FigureTitle" align="center">Figure 1&#xA0;&#x2014; Split-it-right sample divider</p></div>
428
433
  </div>
429
434
  <p class="zzSTDTitle1"></p>
@@ -94,7 +94,7 @@ RSpec.describe IsoDoc do
94
94
  <p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products</i></p>
95
95
  <p id="ISO16634" class="NormRef">ISO 16634:-- (all parts)<a rel="footnote" href="#fn:1" epub:type="footnote"><sup>1</sup></a>, <i> Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i></p>
96
96
  <p id="ISO20483" class="NormRef">ISO 20483:2013&#8211;2014, <i> Cereals and pulses</i></p>
97
- <p id="ref1" class="Biblio">ICC 167, <span style="font-variant:small-caps;">Standard No I.C.C 167</span>. <i>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</i> (see <a href="http://www.icc.or.at">http://www.icc.or.at</a>)</p>
97
+ <p id="ref1" class="NormRef">ICC 167, <span style="font-variant:small-caps;">Standard No I.C.C 167</span>. <i>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</i> (see <a href="http://www.icc.or.at">http://www.icc.or.at</a>)</p>
98
98
  </div>
99
99
  <br/>
100
100
  <div>
@@ -92,7 +92,7 @@ RSpec.describe IsoDoc do
92
92
  <h1>2.&#160; Normative references</h1>
93
93
  <p>There are no normative references in this document.</p>
94
94
  </div>
95
- <div id="H"><h1>3.&#160; Terms and definitions</h1><p>For the purposes of this document,
95
+ <div id="H"><h1>3.&#160; Terms, definitions, symbols and abbreviated terms</h1><p>For the purposes of this document,
96
96
  the following terms and definitions apply.</p>
97
97
  <p>ISO and IEC maintain terminological databases for use in
98
98
  standardization at the following addresses:</p>
@@ -260,7 +260,7 @@ OUTPUT
260
260
  <h1>2.<span style="mso-tab-count:1">&#160; </span>Normative references</h1>
261
261
  <p>There are no normative references in this document.</p>
262
262
  </div>
263
- <div id="H"><h1>3.<span style="mso-tab-count:1">&#160; </span>Terms and definitions</h1><p>For the purposes of this document,
263
+ <div id="H"><h1>3.<span style="mso-tab-count:1">&#160; </span>Terms, definitions, symbols and abbreviated terms</h1><p>For the purposes of this document,
264
264
  the following terms and definitions apply.</p>
265
265
  <p>ISO and IEC maintain terminological databases for use in
266
266
  standardization at the following addresses:</p>
@@ -111,7 +111,7 @@ RSpec.describe IsoDoc do
111
111
  <dd>A type of rice</dd>
112
112
  </dl>
113
113
  <div id="" class="Note">
114
- <p class="Note"><span class="note_label">NOTE</span>&#160; This is a table about rice</p>
114
+ <p><span class="note_label">NOTE</span>&#160; This is a table about rice</p>
115
115
  </div>
116
116
  </table>
117
117
  </div>
@@ -92,8 +92,8 @@ RSpec.describe IsoDoc do
92
92
  <li>A</li>
93
93
  </ul>
94
94
  </td></tr></table>
95
- <div class="Note"><p class="Note">Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
96
- <div class="Note"><p class="Note">Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
95
+ <div class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
96
+ <div class="Note"><p>Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
97
97
  <p>[TERMREF]
98
98
  <a href="#ISO7301">ISO 7301: 2011, 3.1</a>
99
99
  [/TERMREF]</p></div>
@@ -101,6 +101,109 @@ RSpec.describe IsoDoc do
101
101
  </body>
102
102
  </head>
103
103
  </html>
104
+ OUTPUT
105
+ end
106
+
107
+ it "processes IsoXML terms (Word)" do
108
+ expect(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
109
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
110
+ <sections>
111
+ <terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
112
+
113
+ <term id="paddy1"><preferred>paddy</preferred>
114
+ <domain>rice</domain>
115
+ <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
116
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
117
+ <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
118
+ <ul>
119
+ <li>A</li>
120
+ </ul>
121
+ </termexample>
122
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
123
+ <ul>
124
+ <li>A</li>
125
+ </ul>
126
+ </termexample>
127
+
128
+ <termsource status="modified">
129
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301: 2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
130
+ <modification>
131
+ <p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
132
+ </modification>
133
+ </termsource></term>
134
+
135
+ <term id="paddy"><preferred>paddy</preferred><admitted>paddy rice</admitted>
136
+ <admitted>rough rice</admitted>
137
+ <deprecates>cargo rice</deprecates>
138
+ <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
139
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
140
+ <ul>
141
+ <li>A</li>
142
+ </ul>
143
+ </termexample>
144
+ <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
145
+ <p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
146
+ </termnote>
147
+ <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
148
+ <ul><li>A</li></ul>
149
+ <p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
150
+ </termnote>
151
+ <termsource status="identical">
152
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301: 2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
153
+ </termsource></term>
154
+ </terms>
155
+ </sections>
156
+ </iso-standard>
157
+ INPUT
158
+ #{WORD_HDR}
159
+ <p class="zzSTDTitle1"/>
160
+ <div id="_terms_and_definitions"><h1>1.<span style="mso-tab-count:1">&#160; </span>Terms and definitions</h1><p>For the purposes of this document,
161
+ the following terms and definitions apply.</p>
162
+ <p>ISO and IEC maintain terminological databases for use in
163
+ standardization at the following addresses:</p>
164
+
165
+ <ul>
166
+ <li> <p>ISO Online browsing platform: available at
167
+ <a href="http://www.iso.org/obp">http://www.iso.org/obp</a></p> </li>
168
+ <li> <p>IEC Electropedia: available at
169
+ <a href="http://www.electropedia.org">http://www.electropedia.org</a>
170
+ </p> </li> </ul>
171
+ <p class="TermNum" id="paddy1">1.1</p><p class="Terms" style="text-align:left;">paddy</p>
172
+
173
+ <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">&lt;rice&gt; rice retaining its husk after threshing</p>
174
+ <table id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example"><tr><td width="110pt" valign="top" class="example_label" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE 1</td><td valign="top" class="example">
175
+ <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
176
+ <ul>
177
+ <li>A</li>
178
+ </ul>
179
+ </td></tr></table>
180
+ <table id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><tr><td width="110pt" valign="top" class="example_label" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE 2</td><td valign="top" class="example">
181
+ <ul>
182
+ <li>A</li>
183
+ </ul>
184
+ </td></tr></table>
185
+
186
+ <p>[TERMREF]
187
+ <a href="#ISO7301">ISO 7301: 2011, 3.1</a>
188
+ [MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
189
+ [/TERMREF]</p><p class="TermNum" id="paddy">1.2</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
190
+ <p class="AltTerms" style="text-align:left;">rough rice</p>
191
+ <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
192
+ <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
193
+ <table id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><tr><td width="110pt" valign="top" class="example_label" style="width:82.8pt;padding:.75pt .75pt .75pt .75pt">EXAMPLE 1</td><td valign="top" class="example">
194
+ <ul>
195
+ <li>A</li>
196
+ </ul>
197
+ </td></tr></table>
198
+ <div class="Note"><p class="Note">Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
199
+ <div class="Note"><p class="Note">Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
200
+ <p>[TERMREF]
201
+ <a href="#ISO7301">ISO 7301: 2011, 3.1</a>
202
+ [/TERMREF]</p></div>
203
+ </div>
204
+ </body>
205
+ </html>
206
+
104
207
  OUTPUT
105
208
  end
106
209
  end
@@ -72,7 +72,7 @@ RSpec.describe IsoDoc do
72
72
  <div id="scope">
73
73
  <h1>1.&#160; Scope</h1>
74
74
  <div id="N" class="Note">
75
- <p class="Note"><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
75
+ <p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p>
76
76
  </div>
77
77
  <p>
78
78
  <a href="#N">Note</a>
@@ -92,8 +92,8 @@ RSpec.describe IsoDoc do
92
92
  <div id="widgets">
93
93
  <h1>3.&#160; Widgets</h1>
94
94
  <div id="widgets1">
95
- <div id="note1" class="Note"><p class="Note"><span class="note_label">NOTE 1</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
96
- <div id="note2" class="Note"><p class="Note"><span class="note_label">NOTE 2</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
95
+ <div id="note1" class="Note"><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></div>
96
+ <div id="note2" class="Note"><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></div>
97
97
  <p> <a href="#note1">Note 1</a> <a href="#note2">Note 2</a> </p>
98
98
 
99
99
  </div>
@@ -101,11 +101,11 @@ RSpec.describe IsoDoc do
101
101
  <br/>
102
102
  <div id="annex1" class="Section3">
103
103
  <div id="annex1a">
104
- <div id="AN" class="Note"><p class="Note"><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
104
+ <div id="AN" class="Note"><p><span class="note_label">NOTE</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
105
105
  </div>
106
106
  <div id="annex1b">
107
- <div id="Anote1" class="Note"><p class="Note"><span class="note_label">NOTE 1</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
108
- <div id="Anote2" class="Note"><p class="Note"><span class="note_label">NOTE 2</span>&#160; These results are based on a study carried out on three different types of kernel.</p></div>
107
+ <div id="Anote1" class="Note"><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></div>
108
+ <div id="Anote2" class="Note"><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></div>
109
109
  </div>
110
110
  </div>
111
111
  </div>
@@ -190,7 +190,7 @@ RSpec.describe IsoDoc do
190
190
  <h1>1.&#160; Scope</h1>
191
191
  <div id="N" class="figure">
192
192
 
193
- <img src="rice_images/rice_image1.png"/>
193
+ <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
194
194
  <p class="FigureTitle" align="center">Figure 1&#160;&#8212; Split-it-right sample divider</p></div>
195
195
  <p>
196
196
  <a href="#N">Figure 1</a>
@@ -212,11 +212,11 @@ RSpec.describe IsoDoc do
212
212
  <div id="widgets1">
213
213
  <div id="note1" class="figure">
214
214
 
215
- <img src="rice_images/rice_image1.png"/>
215
+ <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
216
216
  <p class="FigureTitle" align="center">Figure 2&#160;&#8212; Split-it-right sample divider</p></div>
217
217
  <div id="note2" class="figure">
218
218
 
219
- <img src="rice_images/rice_image1.png"/>
219
+ <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
220
220
  <p class="FigureTitle" align="center">Figure 3&#160;&#8212; Split-it-right sample divider</p></div>
221
221
  <p> <a href="#note1">Figure 2</a> <a href="#note2">Figure 3</a> </p>
222
222
  </div>
@@ -226,17 +226,17 @@ RSpec.describe IsoDoc do
226
226
  <div id="annex1a">
227
227
  <div id="AN" class="figure">
228
228
 
229
- <img src="rice_images/rice_image1.png"/>
229
+ <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
230
230
  <p class="FigureTitle" align="center">Figure A.1&#160;&#8212; Split-it-right sample divider</p></div>
231
231
  </div>
232
232
  <div id="annex1b">
233
233
  <div id="Anote1" class="figure">
234
234
 
235
- <img src="rice_images/rice_image1.png"/>
235
+ <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
236
236
  <p class="FigureTitle" align="center">Figure A.2&#160;&#8212; Split-it-right sample divider</p></div>
237
237
  <div id="Anote2" class="figure">
238
238
 
239
- <img src="rice_images/rice_image1.png"/>
239
+ <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
240
240
  <p class="FigureTitle" align="center">Figure A.3&#160;&#8212; Split-it-right sample divider</p></div>
241
241
  </div>
242
242
  </div>
@@ -333,11 +333,11 @@ RSpec.describe IsoDoc do
333
333
  <div id="N" class="figure">
334
334
  <div id="note1" class="figure">
335
335
 
336
- <img src="rice_images/rice_image1.png"/>
336
+ <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
337
337
  <p class="FigureTitle" align="center">Figure 1-1&#160;&#8212; Split-it-right sample divider</p></div>
338
338
  <div id="note2" class="figure">
339
339
 
340
- <img src="rice_images/rice_image1.png"/>
340
+ <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
341
341
  <p class="FigureTitle" align="center">Figure 1-2&#160;&#8212; Split-it-right sample divider</p></div>
342
342
  </div>
343
343
  <p> <a href="#note1">Figure 1-1</a> <a href="#note2">Figure 1-2</a> </p>
@@ -351,11 +351,11 @@ RSpec.describe IsoDoc do
351
351
  <div id="AN" class="figure">
352
352
  <div id="Anote1" class="figure">
353
353
 
354
- <img src="rice_images/rice_image1.png"/>
354
+ <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
355
355
  <p class="FigureTitle" align="center">Figure A.1-1&#160;&#8212; Split-it-right sample divider</p></div>
356
356
  <div id="Anote2" class="figure">
357
357
 
358
- <img src="rice_images/rice_image1.png"/>
358
+ <img src="rice_images/rice_image1.png" height="auto" width="auto"/>
359
359
  <p class="FigureTitle" align="center">Figure A.1-2&#160;&#8212; Split-it-right sample divider</p></div>
360
360
  </div>
361
361
  </div>
@@ -831,9 +831,9 @@ RSpec.describe IsoDoc do
831
831
  <a href="http://www.electropedia.org">http://www.electropedia.org</a>
832
832
  </p> </li> </ul>
833
833
  <p class="TermNum" id="_waxy_rice">2.1</p><p class="Terms" style="text-align:left;">waxy rice</p>
834
- <div class="Note"><p class="Note">Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div><p class="TermNum" id="_nonwaxy_rice">2.2</p><p class="Terms" style="text-align:left;">nonwaxy rice</p>
835
- <div class="Note"><p class="Note">Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
836
- <div class="Note"><p class="Note">Note 2 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div></div>
834
+ <div class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div><p class="TermNum" id="_nonwaxy_rice">2.2</p><p class="Terms" style="text-align:left;">nonwaxy rice</p>
835
+ <div class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
836
+ <div class="Note"><p>Note 2 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div></div>
837
837
  </div>
838
838
  </body>
839
839
  </html>
@@ -963,7 +963,7 @@ RSpec.describe IsoDoc do
963
963
  <h1>2.&#160; Normative references</h1>
964
964
  <p>There are no normative references in this document.</p>
965
965
  </div>
966
- <div id="H"><h1>3.&#160; Terms and definitions</h1><p>For the purposes of this document,
966
+ <div id="H"><h1>3.&#160; Terms, definitions, symbols and abbreviated terms</h1><p>For the purposes of this document,
967
967
  the following terms and definitions apply.</p>
968
968
  <p>ISO and IEC maintain terminological databases for use in
969
969
  standardization at the following addresses:</p>
data/spec/spec_helper.rb CHANGED
@@ -44,3 +44,20 @@ HTML_HDR = <<~END
44
44
  <br/>
45
45
  <div class="main-section">
46
46
  END
47
+
48
+ WORD_HDR = <<~END
49
+ <html xmlns:epub="http://www.idpf.org/2007/ops">
50
+ <head>
51
+ <title>test</title>
52
+ </head>
53
+ <body lang="EN-US" link="blue" vlink="#954F72">
54
+ <div class="WordSection1">
55
+ <p>&#160;</p>
56
+ </div>
57
+ <br clear="all" class="section"/>
58
+ <div class="WordSection2">
59
+ <p>&#160;</p>
60
+ </div>
61
+ <br clear="all" class="section"/>
62
+ <div class="WordSection3">
63
+ END
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: 0.8.1
4
+ version: 0.8.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: 2018-07-02 00:00:00.000000000 Z
11
+ date: 2018-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath
@@ -38,34 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 4.3.4
41
- - !ruby/object:Gem::Dependency
42
- name: image_size
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: mime-types
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
41
  - !ruby/object:Gem::Dependency
70
42
  name: nokogiri
71
43
  requirement: !ruby/object:Gem::Requirement
@@ -126,16 +98,16 @@ dependencies:
126
98
  name: html2doc
127
99
  requirement: !ruby/object:Gem::Requirement
128
100
  requirements:
129
- - - ">="
101
+ - - "~>"
130
102
  - !ruby/object:Gem::Version
131
- version: 0.7.1
103
+ version: 0.8.1
132
104
  type: :runtime
133
105
  prerelease: false
134
106
  version_requirements: !ruby/object:Gem::Requirement
135
107
  requirements:
136
- - - ">="
108
+ - - "~>"
137
109
  - !ruby/object:Gem::Version
138
- version: 0.7.1
110
+ version: 0.8.1
139
111
  - !ruby/object:Gem::Dependency
140
112
  name: liquid
141
113
  requirement: !ruby/object:Gem::Requirement
@@ -334,6 +306,7 @@ files:
334
306
  - ".rubocop.ribose.yml"
335
307
  - ".rubocop.tb.yml"
336
308
  - ".rubocop.yml"
309
+ - ".travis.yml"
337
310
  - CODE_OF_CONDUCT.md
338
311
  - Gemfile
339
312
  - Gemfile.lock
@@ -418,7 +391,7 @@ files:
418
391
  - spec/spec_helper.rb
419
392
  homepage: https://github.com/riboseinc/isodoc
420
393
  licenses:
421
- - MIT
394
+ - BSD-2-Clause
422
395
  metadata: {}
423
396
  post_install_message:
424
397
  rdoc_options: []