isodoc 1.2.5 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +69 -0
  3. data/README.adoc +1 -3
  4. data/isodoc.gemspec +3 -1
  5. data/lib/isodoc-yaml/i18n-en.yaml +1 -0
  6. data/lib/isodoc-yaml/i18n-fr.yaml +8 -7
  7. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
  8. data/lib/isodoc/base_style/all.css +5 -1
  9. data/lib/isodoc/base_style/blocks.scss +2 -2
  10. data/lib/isodoc/base_style/reset.css +5 -1
  11. data/lib/isodoc/base_style/reset.scss +6 -1
  12. data/lib/isodoc/base_style/typography.scss +1 -1
  13. data/lib/isodoc/convert.rb +12 -97
  14. data/lib/isodoc/css.rb +95 -0
  15. data/lib/isodoc/function/inline.rb +0 -33
  16. data/lib/isodoc/function/inline_simple.rb +4 -1
  17. data/lib/isodoc/function/lists.rb +2 -1
  18. data/lib/isodoc/function/references.rb +8 -13
  19. data/lib/isodoc/function/table.rb +10 -0
  20. data/lib/isodoc/function/to_word_html.rb +3 -2
  21. data/lib/isodoc/gem_tasks.rb +4 -0
  22. data/lib/isodoc/html_function/html.rb +1 -0
  23. data/lib/isodoc/html_function/postprocess.rb +12 -3
  24. data/lib/isodoc/i18n.rb +23 -51
  25. data/lib/isodoc/metadata.rb +42 -115
  26. data/lib/isodoc/metadata_contributor.rb +90 -0
  27. data/lib/isodoc/metadata_date.rb +11 -0
  28. data/lib/isodoc/presentation_function/bibdata.rb +79 -7
  29. data/lib/isodoc/presentation_function/block.rb +14 -9
  30. data/lib/isodoc/presentation_function/inline.rb +126 -22
  31. data/lib/isodoc/presentation_function/section.rb +6 -0
  32. data/lib/isodoc/presentation_xml_convert.rb +4 -0
  33. data/lib/isodoc/version.rb +1 -1
  34. data/lib/isodoc/word_convert.rb +0 -20
  35. data/lib/isodoc/word_function/body.rb +12 -0
  36. data/lib/isodoc/word_function/postprocess.rb +38 -80
  37. data/lib/isodoc/word_function/postprocess_cover.rb +55 -0
  38. data/lib/isodoc/word_function/table.rb +10 -0
  39. data/lib/isodoc/xref.rb +1 -0
  40. data/lib/isodoc/xref/xref_counter.rb +20 -9
  41. data/lib/isodoc/xref/xref_gen.rb +20 -2
  42. data/lib/isodoc/xslfo_convert.rb +6 -1
  43. data/spec/assets/html.scss +14 -0
  44. data/spec/assets/i18n.yaml +17 -9
  45. data/spec/isodoc/blocks_spec.rb +88 -240
  46. data/spec/isodoc/cleanup_spec.rb +0 -1
  47. data/spec/isodoc/footnotes_spec.rb +4 -5
  48. data/spec/isodoc/i18n_spec.rb +73 -38
  49. data/spec/isodoc/inline_spec.rb +177 -199
  50. data/spec/isodoc/lists_spec.rb +1 -1
  51. data/spec/isodoc/metadata_spec.rb +68 -20
  52. data/spec/isodoc/postproc_spec.rb +306 -8
  53. data/spec/isodoc/presentation_xml_spec.rb +584 -1
  54. data/spec/isodoc/ref_spec.rb +327 -12
  55. data/spec/isodoc/table_spec.rb +28 -0
  56. data/spec/isodoc/xref_spec.rb +162 -17
  57. data/spec/spec_helper.rb +6 -0
  58. metadata +35 -7
  59. data/.github/workflows/macos.yml +0 -42
  60. data/.github/workflows/ubuntu.yml +0 -62
  61. data/.github/workflows/windows.yml +0 -44
@@ -203,7 +203,7 @@ RSpec.describe IsoDoc do
203
203
  <br/>
204
204
  <div>
205
205
  <h1 class="ForewordTitle">Foreword</h1>
206
- <ol type="a" id="_ae34a226-aab4-496d-987b-1aa7b6314026">
206
+ <ol type="I" id="_ae34a226-aab4-496d-987b-1aa7b6314026">
207
207
  <li id="_ae34a226-aab4-496d-987b-1aa7b6314027">
208
208
  <p id="_0091a277-fb0e-424a-aea8-f0001303fe78">all information necessary for the complete identification of the sample;</p>
209
209
  </li>
@@ -7,7 +7,7 @@ RSpec.describe IsoDoc do
7
7
  arr = c.convert_init(<<~"INPUT", "test", false)
8
8
  <iso-standard xmlns="http://riboseinc.com/isoxml">
9
9
  INPUT
10
- expect(Hash[c.info(Nokogiri::XML(<<~"INPUT"), nil).sort]).to be_equivalent_to <<~"OUTPUT"
10
+ expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
11
11
  <iso-standard xmlns="http://riboseinc.com/isoxml">
12
12
  <bibdata type="standard">
13
13
  <title>The Incredible Mr Ripley</title>
@@ -18,6 +18,8 @@ RSpec.describe IsoDoc do
18
18
  <uri type="pdf">URL D</uri>
19
19
  <uri type="doc">URL E</uri>
20
20
  <docidentifier>17301-1</docidentifier>
21
+ <docidentifier type="ISBN">ISBN 13</docidentifier>
22
+ <docidentifier type="ISBN10">ISBN 10</docidentifier>
21
23
  <docnumber>17301</docnumber>
22
24
  <date type="published"><on>2011</on></date>
23
25
  <date type="accessed"><on>2012</on></date>
@@ -73,6 +75,9 @@ RSpec.describe IsoDoc do
73
75
  </name>
74
76
  </person>
75
77
  </contributor>
78
+ <note type="title-footnote"><p>A footnote</p></note>
79
+ <note type="iso"><p>A note</p></note>
80
+ <note type="title-footnote"><p>Another footnote</p></note>
76
81
  <language>en</language>
77
82
  <script>Latn</script>
78
83
  <status>
@@ -95,8 +100,6 @@ RSpec.describe IsoDoc do
95
100
  <doctype>international-standard</doctype>
96
101
  </ext>
97
102
  </bibdata>
98
- <local_bibdata type="standard">
99
- </local_bibdata>
100
103
  </iso-standard>
101
104
  INPUT
102
105
  {:accesseddate=>"2012",
@@ -113,25 +116,32 @@ INPUT
113
116
  :docnumeric=>"17301",
114
117
  :doctitle=>"Cereals and pulses",
115
118
  :doctype=>"International Standard",
119
+ :doctype_display=>"International Standard",
116
120
  :docyear=>"2016",
117
121
  :draft=>"0.4",
118
122
  :draftinfo=>" (draft 0.4, 2016-05-01)",
119
123
  :edition=>"2",
120
124
  :html=>"URL B",
121
125
  :implementeddate=>"XXX",
126
+ :isbn=>"ISBN 13",
127
+ :isbn10=>"ISBN 10",
122
128
  :issueddate=>"XXX",
123
129
  :iteration=>"2",
124
130
  :keywords=>["KW2", "KW1", "KW3"],
131
+ :lang=>"en",
125
132
  :obsoleteddate=>"2014",
126
133
  :pdf=>"URL D",
127
134
  :publisheddate=>"2011",
128
- :publisher=>"",
129
135
  :receiveddate=>"XXX",
130
136
  :revdate=>"2016-05-01",
131
137
  :revdate_monthyear=>"May 2016",
138
+ :script=>"Latn",
132
139
  :stage=>"Committee Draft",
140
+ :stage_display=>"Committee Draft",
133
141
  :stageabbr=>"CD",
134
142
  :substage=>"Withdrawn",
143
+ :substage_display=>"Withdrawn",
144
+ :title_footnote=>["A footnote", "Another footnote"],
135
145
  :transmitteddate=>"2020",
136
146
  :unchangeddate=>"2019",
137
147
  :unpublished=>true,
@@ -148,7 +158,7 @@ OUTPUT
148
158
  arr = c.convert_init(<<~"INPUT", "test", false)
149
159
  <iso-standard xmlns="http://riboseinc.com/isoxml">
150
160
  INPUT
151
- expect(Hash[c.info(Nokogiri::XML(<<~"INPUT"), nil).sort]).to be_equivalent_to <<~"OUTPUT"
161
+ expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
152
162
  <iso-standard xmlns="http://riboseinc.com/isoxml">
153
163
  <bibdata type="standard">
154
164
  <title language="fr" format="text/plain">Céréales et légumineuses</ti>
@@ -169,7 +179,15 @@ OUTPUT
169
179
  <role type="publisher"/>
170
180
  <organization>
171
181
  <name>International Organization for Standardization</name>
182
+ <subdivision>Subdivision</subdivision>
172
183
  <abbreviation>ISO</abbreviation>
184
+ <address>
185
+ <formattedAddress>1 Infinity Loop + California</formattedAddress>
186
+ </address>
187
+ <phone>3333333</phone>
188
+ <phone type='fax'>4444444</phone>
189
+ <email>x@example.com</email>
190
+ <uri>http://www.example.com</uri>
173
191
  </organization>
174
192
  </contributor>
175
193
  <contributor>
@@ -215,8 +233,6 @@ OUTPUT
215
233
  INPUT
216
234
  {:accesseddate=>"XXX",
217
235
  :agency=>"ISO/IEC/IEEE",
218
- :authors=>[],
219
- :authors_affiliations=>{},
220
236
  :circulateddate=>"XXX",
221
237
  :confirmeddate=>"XXX",
222
238
  :copieddate=>"XXX",
@@ -225,23 +241,31 @@ INPUT
225
241
  :docnumeric=>"17301",
226
242
  :doctitle=>"Cereals and pulses",
227
243
  :doctype=>"International Standard",
244
+ :doctype_display=>"International Standard",
228
245
  :docyear=>"2016",
229
246
  :draft=>"12",
230
247
  :draftinfo=>" (draft 12, 2016-05)",
231
- :edition=>nil,
232
248
  :implementeddate=>"XXX",
233
249
  :issueddate=>"XXX",
234
- :keywords=>[],
250
+ :lang=>"en",
235
251
  :obsoleteddate=>"XXX",
236
252
  :obsoletes=>"IEC 8121",
237
253
  :obsoletes_part=>"3.1",
238
254
  :partof=>"IEC 8122",
255
+ :pub_address=>"1 Infinity Loop + California",
256
+ :pub_email=>"x@example.com",
257
+ :pub_fax=>"4444444",
258
+ :pub_phone=>"3333333",
259
+ :pub_uri=>"http://www.example.com",
239
260
  :publisheddate=>"2011-01",
240
261
  :publisher=>"International Organization for Standardization, International Electrotechnical Commission and Institute of Electrical and Electronics Engineers",
241
262
  :receiveddate=>"XXX",
242
263
  :revdate=>"2016-05",
243
264
  :revdate_monthyear=>"May 2016",
265
+ :script=>"Latn",
244
266
  :stage=>"Published",
267
+ :stage_display=>"Published",
268
+ :subdivision=>"Subdivision",
245
269
  :transmitteddate=>"XXX",
246
270
  :unchangeddate=>"XXX",
247
271
  :unpublished=>false,
@@ -258,10 +282,21 @@ OUTPUT
258
282
  <bibdata type="standard">
259
283
  <language>fr</language>
260
284
  <script>Latn</script>
285
+ <status>
286
+ <stage lang="">Committee Draft</stage>
287
+ <stage lang=fr">Projet de comité</stage>
288
+ <substage lang="">Withdrawn</substage>
289
+ <substage lang="fr">Rétiré</substage>
290
+ <iteration>2</iteration>
291
+ </status>
292
+ <ext>
293
+ <doctype lang="">international-standard</doctype>
294
+ <doctype lang="fr">Standard international</doctype>
295
+ </ext>
261
296
  </bibdata>
262
297
  </iso-standard>
263
298
  INPUT
264
- expect(Hash[c.info(Nokogiri::XML(<<~"INPUT"), nil).sort]).to be_equivalent_to <<~"OUTPUT"
299
+ expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
265
300
  <iso-standard xmlns="http://riboseinc.com/isoxml">
266
301
  <bibdata type="standard">
267
302
  <title language="fr" format="text/plain">Céréales et légumineuses</ti>
@@ -294,7 +329,13 @@ OUTPUT
294
329
  </contributor>
295
330
  <language>fr</language>
296
331
  <script>Latn</script>
297
- <status><stage>Published</stage></status>
332
+ <status>
333
+ <stage language="">Committee Draft</stage>
334
+ <stage language="fr">Projet de comité</stage>
335
+ <substage language="">Withdrawn</substage>
336
+ <substage language="fr">Rétiré</substage>
337
+ <iteration>2</iteration>
338
+ </status>
298
339
  <copyright>
299
340
  <from>2016</from>
300
341
  <owner>
@@ -303,37 +344,44 @@ OUTPUT
303
344
  </organization>
304
345
  </owner>
305
346
  </copyright>
347
+ <ext>
348
+ <doctype language="">international-standard</doctype>
349
+ <doctype language="fr">Standard international</doctype>
350
+ </ext>
306
351
  </bibdata>
307
352
  </iso-standard>
308
353
  INPUT
309
354
  {:accesseddate=>"XXX",
310
355
  :agency=>"ISO/IEC",
311
- :authors=>[],
312
- :authors_affiliations=>{},
313
356
  :circulateddate=>"XXX",
314
357
  :confirmeddate=>"XXX",
315
358
  :copieddate=>"XXX",
316
359
  :createddate=>"XXX",
317
360
  :docnumber=>"17301-1-3",
318
361
  :docnumeric=>"17301",
319
- :doctitle=>"Cereals and pulses",
362
+ :doctitle=>"Céréales et légumineuses",
363
+ :doctype=>"International Standard",
364
+ :doctype_display=>"Standard International",
320
365
  :docyear=>"2016",
321
- :draft=>nil,
322
- :draftinfo=>"",
323
- :edition=>nil,
324
366
  :implementeddate=>"XXX",
325
367
  :issueddate=>"XXX",
326
- :keywords=>[],
368
+ :iteration=>"2",
369
+ :lang=>"fr",
327
370
  :obsoleteddate=>"XXX",
328
371
  :publisheddate=>"2011-01",
329
372
  :publisher=>"International Organization for Standardization et International Electrotechnical Commission",
330
373
  :receiveddate=>"XXX",
331
374
  :revdate=>"2016-05",
332
375
  :revdate_monthyear=>"Mai 2016",
333
- :stage=>"Published",
376
+ :script=>"Latn",
377
+ :stage=>"Committee Draft",
378
+ :stage_display=>"Projet De Comité",
379
+ :stageabbr=>"CD",
380
+ :substage=>"Withdrawn",
381
+ :substage_display=>"Rétiré",
334
382
  :transmitteddate=>"XXX",
335
383
  :unchangeddate=>"XXX",
336
- :unpublished=>false,
384
+ :unpublished=>true,
337
385
  :updateddate=>"XXX",
338
386
  :vote_endeddate=>"XXX",
339
387
  :vote_starteddate=>"XXX"}
@@ -139,7 +139,7 @@ expect(File.exist?("test.doc")).to be true
139
139
  it "generates HTML output docs with complete configuration" do
140
140
  FileUtils.rm_f "test.doc"
141
141
  FileUtils.rm_f "test.html"
142
- IsoDoc::HtmlConvert.new({bodyfont: "Zapf", htmlstylesheet: "spec/assets/html.scss", htmlcoverpage: "spec/assets/htmlcover.html", htmlintropage: "spec/assets/htmlintro.html", scripts: "spec/assets/scripts.html", i18nyaml: "spec/assets/i18n.yaml", ulstyle: "l1", olstyle: "l2"}).convert("test", <<~"INPUT", false)
142
+ IsoDoc::HtmlConvert.new({bodyfont: "Zapf", monospacefont: "Consolas", headerfont: "Comic Sans", normalfontsize: "30pt", monospacefontsize: "29pt", smallerfontsize: "28pt", footnotefontsize: "27pt", htmlstylesheet: "spec/assets/html.scss", htmlcoverpage: "spec/assets/htmlcover.html", htmlintropage: "spec/assets/htmlintro.html", scripts: "spec/assets/scripts.html", i18nyaml: "spec/assets/i18n.yaml", ulstyle: "l1", olstyle: "l2"}).convert("test", <<~"INPUT", false)
143
143
  <iso-standard xmlns="http://riboseinc.com/isoxml">
144
144
  <preface><foreword>
145
145
  <note>
@@ -150,7 +150,13 @@ expect(File.exist?("test.doc")).to be true
150
150
  INPUT
151
151
  html = File.read("test.html")
152
152
  expect(html).to match(/another empty stylesheet/)
153
- expect(html).to match(/font-family: Zapf/)
153
+ expect(html).to match(/p \{[^}]*?font-family: Zapf/m)
154
+ expect(html).to match(/code \{[^}]*?font-family: Consolas/m)
155
+ expect(html).to match(/h1 \{[^}]*?font-family: Comic Sans/m)
156
+ expect(html).to match(/p \{[^}]*?font-size: 30pt/m)
157
+ expect(html).to match(/code \{[^}]*?font-size: 29pt/m)
158
+ expect(html).to match(/p\.note \{[^}]*?font-size: 28pt/m)
159
+ expect(html).to match(/aside \{[^}]*?font-size: 27pt/m)
154
160
  expect(html).to match(/an empty html cover page/)
155
161
  expect(html).to match(/an empty html intro page/)
156
162
  expect(html).to match(/This is > a script/)
@@ -172,7 +178,13 @@ expect(File.exist?("test.doc")).to be true
172
178
  INPUT
173
179
  html = File.read("test.html")
174
180
  expect(html).to match(/another empty stylesheet/)
175
- expect(html).to match(/font-family: Arial/)
181
+ expect(html).to match(/p \{[^}]*?font-family: Arial/m)
182
+ expect(html).to match(/code \{[^}]*?font-family: Courier/m)
183
+ expect(html).to match(/h1 \{[^}]*?font-family: Arial/m)
184
+ expect(html).to match(/p \{[^}]*?font-size: 1em;/m)
185
+ expect(html).to match(/code \{[^}]*?font-size: 0.8em/m)
186
+ expect(html).to match(/p\.note \{[^}]*?font-size: 0.9em/m)
187
+ expect(html).to match(/aside \{[^}]*?font-size: 0.9em/m)
176
188
  expect(html).to match(/an empty html cover page/)
177
189
  expect(html).to match(/an empty html intro page/)
178
190
  expect(html).to match(/This is > a script/)
@@ -183,7 +195,7 @@ expect(File.exist?("test.doc")).to be true
183
195
  it "generates Word output docs with complete configuration" do
184
196
  FileUtils.rm_f "test.doc"
185
197
  FileUtils.rm_f "test.html"
186
- IsoDoc::WordConvert.new({bodyfont: "Zapf", wordstylesheet: "spec/assets/html.scss", standardstylesheet: "spec/assets/std.css", header: "spec/assets/header.html", wordcoverpage: "spec/assets/wordcover.html", wordintropage: "spec/assets/wordintro.html", i18nyaml: "spec/assets/i18n.yaml", ulstyle: "l1", olstyle: "l2"}).convert("test", <<~"INPUT", false)
198
+ IsoDoc::WordConvert.new({bodyfont: "Zapf", monospacefont: "Consolas", headerfont: "Comic Sans", normalfontsize: "30pt", monospacefontsize: "29pt", smallerfontsize: "28pt", footnotefontsize: "27pt", wordstylesheet: "spec/assets/html.scss", standardstylesheet: "spec/assets/std.css", header: "spec/assets/header.html", wordcoverpage: "spec/assets/wordcover.html", wordintropage: "spec/assets/wordintro.html", i18nyaml: "spec/assets/i18n.yaml", ulstyle: "l1", olstyle: "l2"}).convert("test", <<~"INPUT", false)
187
199
  <iso-standard xmlns="http://riboseinc.com/isoxml">
188
200
  <preface><foreword>
189
201
  <note>
@@ -194,7 +206,13 @@ expect(File.exist?("test.doc")).to be true
194
206
  INPUT
195
207
  word = File.read("test.doc")
196
208
  expect(word).to match(/another empty stylesheet/)
197
- expect(word).to match(/font-family: Zapf/)
209
+ expect(word).to match(/p \{[^}]*?font-family: Zapf/m)
210
+ expect(word).to match(/code \{[^}]*?font-family: Consolas/m)
211
+ expect(word).to match(/h1 \{[^}]*?font-family: Comic Sans/m)
212
+ expect(word).to match(/p \{[^}]*?font-size: 30pt/m)
213
+ expect(word).to match(/code \{[^}]*?font-size: 29pt/m)
214
+ expect(word).to match(/p\.note \{[^}]*?font-size: 28pt/m)
215
+ expect(word).to match(/aside \{[^}]*?font-size: 27pt/m)
198
216
  expect(word).to match(/a third empty stylesheet/)
199
217
  #expect(word).to match(/<title>test<\/title>/)
200
218
  expect(word).to match(/test_files\/header.html/)
@@ -217,7 +235,13 @@ expect(File.exist?("test.doc")).to be true
217
235
  INPUT
218
236
  word = File.read("test.doc")
219
237
  expect(word).to match(/another empty stylesheet/)
220
- expect(word).to match(/font-family: Arial/)
238
+ expect(word).to match(/p \{[^}]*?font-family: Arial/m)
239
+ expect(word).to match(/code \{[^}]*?font-family: Courier/m)
240
+ expect(word).to match(/h1 \{[^}]*?font-family: Arial/m)
241
+ expect(word).to match(/p \{[^}]*?font-size: 12pt/m)
242
+ expect(word).to match(/code \{[^}]*?font-size: 11pt/m)
243
+ expect(word).to match(/p\.note \{[^}]*?font-size: 10pt/m)
244
+ expect(word).to match(/aside \{[^}]*?font-size: 9pt/m)
221
245
  expect(word).to match(/a third empty stylesheet/)
222
246
  #expect(word).to match(/<title>test<\/title>/)
223
247
  expect(word).to match(/test_files\/header.html/)
@@ -512,7 +536,7 @@ TOCLEVEL
512
536
  <p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">This is a footnote.</p>
513
537
  </fn><clause id="N" inline-header="false" obligation="normative">
514
538
  <title>Introduction to this<fn reference="2">
515
- <p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">Formerly denoted as 15 % (m/m).</p>
539
+ Formerly denoted as 15 % (m/m).
516
540
  </fn></title>
517
541
  </clause>
518
542
  <clause id="O" inline-header="false" obligation="normative">
@@ -548,7 +572,7 @@ TOCLEVEL
548
572
  </a>This is a footnote.</p>
549
573
  <a href="#fnref:1">&#x21A9;</a></aside>
550
574
  <aside id="fn:2" class="footnote">
551
- <p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a class='FootnoteRef' href='#fn:2'><sup>2</sup></a>Formerly denoted as 15 % (m/m).</p>
575
+ <a class='FootnoteRef' href='#fn:2'><sup>2</sup></a>Formerly denoted as 15 % (m/m).
552
576
  <a href="#fnref:2">&#x21A9;</a></aside>
553
577
  </main>
554
578
  OUTPUT
@@ -905,6 +929,7 @@ TOCLEVEL
905
929
  </m:r>
906
930
  </m:oMath>
907
931
  </span>
932
+ <span style='mso-tab-count:1'>&#xA0; </span>
908
933
  </p>
909
934
  </div>
910
935
  </div>
@@ -1569,4 +1594,277 @@ OUTPUT
1569
1594
  OUTPUT
1570
1595
  end
1571
1596
 
1597
+
1598
+ it "allocate widths to tables (Word)" do
1599
+ expect(xmlpp(IsoDoc::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.scss", filename: "test"}).word_cleanup(Nokogiri::XML(<<~INPUT)).to_xml).sub(/^.*<main/m, "<main").sub(%r{</main>.*$}m, "</main>")).to be_equivalent_to xmlpp(<<~"OUTPUT")
1600
+ <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
1601
+ <head><style/></head>
1602
+ <body lang='EN-US' link='blue' vlink='#954F72'>
1603
+ <div class='WordSection1'>
1604
+ <p>&#160;</p>
1605
+ </div>
1606
+ <p>
1607
+ <br clear='all' class='section'/>
1608
+ </p>
1609
+ <div class='WordSection2'>
1610
+ <p>
1611
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1612
+ </p>
1613
+ <div>
1614
+ <h1 class='ForewordTitle'>Foreword</h1>
1615
+ <p class='TableTitle' style='text-align:center;'>
1616
+ Table 1&#160;&#8212; Repeatability and reproducibility of
1617
+ <i>husked</i>
1618
+ rice yield
1619
+ <span style='mso-bookmark:_Ref'>
1620
+ <a class='FootnoteRef' href='#ftn1' epub:type='footnote'>
1621
+ <sup>1</sup>
1622
+ </a>
1623
+ </span>
1624
+ </p>
1625
+ <div align='center' class='table_container'>
1626
+ <table id='tableD-1' class='MsoISOTable' style='mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;page-break-after: avoid;page-break-inside: avoid;' title='tool tip' summary='long desc' width='70%'>
1627
+ <colgroup>
1628
+ <col width='30%'/>
1629
+ <col width='20%'/>
1630
+ <col width='20%'/>
1631
+ <col width='20%'/>
1632
+ <col width='10%'/>
1633
+ </colgroup>
1634
+ <thead>
1635
+ <tr>
1636
+ <td rowspan='2' align='left' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>Description</td>
1637
+ <td colspan='4' align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;'>Rice sample</td>
1638
+ </tr>
1639
+ <tr>
1640
+ <td align='left' valign="top" style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>Arborio</td>
1641
+ <td align='center' valign="middle" style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>
1642
+ Drago
1643
+ <a href='#tableD-1a' class='TableFootnoteRef'>a</a>
1644
+ <aside>
1645
+ <div id='ftntableD-1a'>
1646
+ <span>
1647
+ <span id='tableD-1a' class='TableFootnoteRef'>a</span>
1648
+ <span style='mso-tab-count:1'>&#160; </span>
1649
+ </span>
1650
+ <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
1651
+ </div>
1652
+ </aside>
1653
+ </td>
1654
+ <td align='center' valign="bottom" style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>
1655
+ Balilla
1656
+ <a href='#tableD-1a' class='TableFootnoteRef'>a</a>
1657
+ </td>
1658
+ <td align='center' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>Thaibonnet</td>
1659
+ </tr>
1660
+ </thead>
1661
+ <tbody>
1662
+ <tr>
1663
+ <th align='left' style='font-weight:bold;border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;'>Number of laboratories retained after eliminating outliers</th>
1664
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;'>13</td>
1665
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;'>11</td>
1666
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;'>13</td>
1667
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;'>13</td>
1668
+ </tr>
1669
+ <tr>
1670
+ <td align='left' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>Mean value, g/100 g</td>
1671
+ <td align='center' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>81,2</td>
1672
+ <td align='center' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>82,0</td>
1673
+ <td align='center' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>81,8</td>
1674
+ <td align='center' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>77,7</td>
1675
+ </tr>
1676
+ </tbody>
1677
+ <tfoot>
1678
+ <tr>
1679
+ <td align='left' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>
1680
+ Reproducibility limit,
1681
+ <span class='stem'>(#(R)#)</span>
1682
+ (= 2,83
1683
+ <span class='stem'>(#(s_R)#)</span>
1684
+ )
1685
+ </td>
1686
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>2,89</td>
1687
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>0,57</td>
1688
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>2,26</td>
1689
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>6,06</td>
1690
+ </tr>
1691
+ </tfoot>
1692
+ <table class='dl'>
1693
+ <tr>
1694
+ <td valign='top' align='left'>
1695
+ <p align='left' style='margin-left:0pt;text-align:left;'>Drago</p>
1696
+ </td>
1697
+ <td valign='top'>A type of rice</td>
1698
+ </tr>
1699
+ </table>
1700
+ <div class='Note'>
1701
+ <p class='Note'>
1702
+ <span class='note_label'>NOTE</span>
1703
+ <span style='mso-tab-count:1'>&#160; </span>
1704
+ This is a table about rice
1705
+ </p>
1706
+ </div>
1707
+ </table>
1708
+ </div>
1709
+ <div align='center' class='table_container'>
1710
+ <table id='tableD-2' class='MsoISOTable' style='mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;'>
1711
+ <tbody>
1712
+ <tr>
1713
+ <td style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>A</td>
1714
+ </tr>
1715
+ </tbody>
1716
+ </table>
1717
+ </div>
1718
+ </div>
1719
+ <p>&#160;</p>
1720
+ </div>
1721
+ <p>
1722
+ <br clear='all' class='section'/>
1723
+ </p>
1724
+ <div class='WordSection3'>
1725
+ <p class='zzSTDTitle1'/>
1726
+ <aside id='ftn1'>
1727
+ <p>X</p>
1728
+ </aside>
1729
+ </div>
1730
+ </body>
1731
+ </html>
1732
+ INPUT
1733
+ <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
1734
+ <head>
1735
+ <style/>
1736
+ </head>
1737
+ <body lang='EN-US' link='blue' vlink='#954F72'>
1738
+ <div class='WordSection1'>
1739
+ <p>&#xA0;</p>
1740
+ </div>
1741
+ <p>
1742
+ <br clear='all' class='section'/>
1743
+ </p>
1744
+ <div class='WordSection2'>
1745
+ <p>
1746
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1747
+ </p>
1748
+ <div>
1749
+ <h1 class='ForewordTitle'>Foreword</h1>
1750
+ <p class='TableTitle' style='text-align:center;'>
1751
+ Table 1&#xA0;&#x2014; Repeatability and reproducibility of
1752
+ <i>husked</i>
1753
+ rice yield
1754
+ <span style='mso-bookmark:_Ref'>
1755
+ <a class='FootnoteRef' href='#ftn1' epub:type='footnote'>
1756
+ <sup>1</sup>
1757
+ </a>
1758
+ </span>
1759
+ </p>
1760
+ <div align='center' class='table_container'>
1761
+ <table id='tableD-1' class='MsoISOTable' style='mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;page-break-after: avoid;page-break-inside: avoid;' title='tool tip' summary='long desc' width='70%'>
1762
+ <colgroup>
1763
+ <col width='30%'/>
1764
+ <col width='20%'/>
1765
+ <col width='20%'/>
1766
+ <col width='20%'/>
1767
+ <col width='10%'/>
1768
+ </colgroup>
1769
+ <thead>
1770
+ <tr>
1771
+ <td rowspan='2' align='left' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='30.0%'>Description</td>
1772
+ <td colspan='4' align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;' width='70.0%'>Rice sample</td>
1773
+ </tr>
1774
+ <tr>
1775
+ <td align='left' valign='top' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='20.0%'>Arborio</td>
1776
+ <td align='center' valign='middle' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='20.0%'>
1777
+ Drago
1778
+ <a href='#tableD-1a' class='TableFootnoteRef'>a</a>
1779
+ <aside>
1780
+ <div id='ftntableD-1a'>
1781
+ <span>
1782
+ <span id='tableD-1a' class='TableFootnoteRef'>a</span>
1783
+ <span style='mso-tab-count:1'>&#xA0; </span>
1784
+ </span>
1785
+ <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
1786
+ </div>
1787
+ </aside>
1788
+ </td>
1789
+ <td align='center' valign='bottom' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='20.0%'>
1790
+ Balilla
1791
+ <a href='#tableD-1a' class='TableFootnoteRef'>a</a>
1792
+ </td>
1793
+ <td align='center' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='10.0%'>Thaibonnet</td>
1794
+ </tr>
1795
+ </thead>
1796
+ <tbody>
1797
+ <tr>
1798
+ <th align='left' style='font-weight:bold;border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;' width='30.0%'>Number of laboratories retained after eliminating outliers</th>
1799
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;' width='20.0%'>13</td>
1800
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;' width='20.0%'>11</td>
1801
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;' width='20.0%'>13</td>
1802
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;' width='10.0%'>13</td>
1803
+ </tr>
1804
+ <tr>
1805
+ <td align='left' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='30.0%'>Mean value, g/100 g</td>
1806
+ <td align='center' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='20.0%'>81,2</td>
1807
+ <td align='center' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='20.0%'>82,0</td>
1808
+ <td align='center' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='20.0%'>81,8</td>
1809
+ <td align='center' style='border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='10.0%'>77,7</td>
1810
+ </tr>
1811
+ </tbody>
1812
+ <tfoot>
1813
+ <tr>
1814
+ <td align='left' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='30.0%'>
1815
+ Reproducibility limit,
1816
+ <span class='stem'>(#(R)#)</span>
1817
+ (= 2,83
1818
+ <span class='stem'>(#(s_R)#)</span>
1819
+ )
1820
+ </td>
1821
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='20.0%'>2,89</td>
1822
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='20.0%'>0,57</td>
1823
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='20.0%'>2,26</td>
1824
+ <td align='center' style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;' width='10.0%'>6,06</td>
1825
+ </tr>
1826
+ </tfoot>
1827
+ <div class='Note'>
1828
+ <p class='Note'>
1829
+ <span class='note_label'>NOTE</span>
1830
+ <span style='mso-tab-count:1'>&#xA0; </span>
1831
+ This is a table about rice
1832
+ </p>
1833
+ </div>
1834
+ </table>
1835
+ <table class='dl'>
1836
+ <tr>
1837
+ <td valign='top' align='left'>
1838
+ <p align='left' style='margin-left:0pt;text-align:left;'>Drago</p>
1839
+ </td>
1840
+ <td valign='top'>A type of rice</td>
1841
+ </tr>
1842
+ </table>
1843
+ </div>
1844
+ <div align='center' class='table_container'>
1845
+ <table id='tableD-2' class='MsoISOTable' style='mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;'>
1846
+ <tbody>
1847
+ <tr>
1848
+ <td style='border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;'>A</td>
1849
+ </tr>
1850
+ </tbody>
1851
+ </table>
1852
+ </div>
1853
+ </div>
1854
+ <p>&#xA0;</p>
1855
+ </div>
1856
+ <p>
1857
+ <br clear='all' class='section'/>
1858
+ </p>
1859
+ <div class='WordSection3'>
1860
+ <p class='zzSTDTitle1'/>
1861
+ <aside id='ftn1'>
1862
+ <p>X</p>
1863
+ </aside>
1864
+ </div>
1865
+ </body>
1866
+ </html>
1867
+ OUTPUT
1868
+ end
1869
+
1572
1870
  end