isodoc 1.2.0 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc-yaml/i18n-fr.yaml +1 -1
  3. data/lib/isodoc/base_style/metanorma_word.css +6 -0
  4. data/lib/isodoc/base_style/metanorma_word.scss +6 -0
  5. data/lib/isodoc/convert.rb +1 -1
  6. data/lib/isodoc/function/blocks.rb +1 -0
  7. data/lib/isodoc/function/cleanup.rb +1 -1
  8. data/lib/isodoc/function/references.rb +4 -2
  9. data/lib/isodoc/function/section.rb +13 -1
  10. data/lib/isodoc/function/table.rb +1 -0
  11. data/lib/isodoc/function/to_word_html.rb +2 -0
  12. data/lib/isodoc/function/utils.rb +2 -2
  13. data/lib/isodoc/html_function/html.rb +1 -0
  14. data/lib/isodoc/i18n.rb +0 -1
  15. data/lib/isodoc/metadata.rb +10 -4
  16. data/lib/isodoc/presentation_function/bibdata.rb +24 -0
  17. data/lib/isodoc/presentation_function/block.rb +14 -0
  18. data/lib/isodoc/presentation_function/inline.rb +27 -14
  19. data/lib/isodoc/presentation_xml_convert.rb +4 -0
  20. data/lib/isodoc/version.rb +1 -1
  21. data/lib/isodoc/word_function/body.rb +1 -0
  22. data/lib/isodoc/word_function/postprocess.rb +1 -1
  23. data/lib/isodoc/word_function/table.rb +3 -2
  24. data/lib/isodoc/xref.rb +1 -0
  25. data/lib/isodoc/xref/xref_anchor.rb +8 -3
  26. data/lib/isodoc/xref/xref_counter.rb +21 -7
  27. data/lib/isodoc/xref/xref_gen.rb +29 -6
  28. data/lib/isodoc/xref/xref_sect_gen.rb +1 -1
  29. data/spec/assets/i18n.yaml +9 -0
  30. data/spec/isodoc/blocks_spec.rb +281 -13
  31. data/spec/isodoc/cleanup_spec.rb +3 -1
  32. data/spec/isodoc/i18n_spec.rb +43 -5
  33. data/spec/isodoc/inline_spec.rb +47 -5
  34. data/spec/isodoc/metadata_spec.rb +3 -1
  35. data/spec/isodoc/postproc_spec.rb +39 -3
  36. data/spec/isodoc/ref_spec.rb +4 -1
  37. data/spec/isodoc/section_spec.rb +134 -10
  38. data/spec/isodoc/table_spec.rb +306 -207
  39. data/spec/isodoc/terms_spec.rb +1 -1
  40. data/spec/isodoc/xref_spec.rb +46 -18
  41. metadata +3 -2
@@ -1,8 +1,8 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
- it "processes IsoXML tables (Presentation XML)" do
5
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
4
+ it "processes IsoXML tables" do
5
+ input = <<~INPUT
6
6
  <iso-standard xmlns="http://riboseinc.com/isoxml">
7
7
  <preface>
8
8
  <foreword>
@@ -14,11 +14,11 @@ RSpec.describe IsoDoc do
14
14
  <td colspan="4" align="center">Rice sample</td>
15
15
  </tr>
16
16
  <tr>
17
- <td align="left">Arborio</td>
18
- <td align="center">Drago<fn reference="a">
17
+ <td valign="top" align="left">Arborio</td>
18
+ <td valign="middle" align="center">Drago<fn reference="a">
19
19
  <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
20
20
  </fn></td>
21
- <td align="center">Balilla<fn reference="a">
21
+ <td valign="bottom" align="center">Balilla<fn reference="a">
22
22
  <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
23
23
  </fn></td>
24
24
  <td align="center">Thaibonnet</td>
@@ -53,7 +53,7 @@ RSpec.describe IsoDoc do
53
53
  <dt>Drago</dt>
54
54
  <dd>A type of rice</dd>
55
55
  </dl>
56
- <note><name>NOTE</name><p>This is a table about rice</p></note>
56
+ <note><p>This is a table about rice</p></note>
57
57
  </table>
58
58
 
59
59
  <table id="tableD-2" unnumbered="true">
@@ -63,8 +63,9 @@ RSpec.describe IsoDoc do
63
63
  </preface>
64
64
  </iso-standard>
65
65
  INPUT
66
- <?xml version='1.0'?>
67
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
66
+
67
+ presxml = <<~OUTPUT
68
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
68
69
  <preface>
69
70
  <foreword>
70
71
  <table id='tableD-1' alt='tool tip' summary='long desc' width='70%' keep-with-next='true' keep-lines-together='true'>
@@ -82,14 +83,14 @@ RSpec.describe IsoDoc do
82
83
  <td colspan='4' align='center'>Rice sample</td>
83
84
  </tr>
84
85
  <tr>
85
- <td align='left'>Arborio</td>
86
- <td align='center'>
86
+ <td valign="top" align='left'>Arborio</td>
87
+ <td valign="middle" align='center'>
87
88
  Drago
88
89
  <fn reference='a'>
89
90
  <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
90
91
  </fn>
91
92
  </td>
92
- <td align='center'>
93
+ <td valign="bottom" align='center'>
93
94
  Balilla
94
95
  <fn reference='a'>
95
96
  <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
@@ -134,7 +135,7 @@ RSpec.describe IsoDoc do
134
135
  <dd>A type of rice</dd>
135
136
  </dl>
136
137
  <note>
137
- <name>NOTENOTE</name>
138
+ <name>NOTE</name>
138
139
  <p>This is a table about rice</p>
139
140
  </note>
140
141
  </table>
@@ -149,70 +150,8 @@ RSpec.describe IsoDoc do
149
150
  </preface>
150
151
  </iso-standard>
151
152
  OUTPUT
152
- end
153
153
 
154
- it "processes IsoXML tables" do
155
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
156
- <iso-standard xmlns="http://riboseinc.com/isoxml">
157
- <preface>
158
- <foreword>
159
- <table id="tableD-1" alt="tool tip" summary="long desc" width="70%" keep-with-next="true" keep-lines-together="true">
160
- <name>Table 1&#xA0;&#x2014; Repeatability and reproducibility of <em>husked</em> rice yield<fn reference="1"><p>X</p></fn></name>
161
- <thead>
162
- <tr>
163
- <td rowspan="2" align="left">Description</td>
164
- <td colspan="4" align="center">Rice sample</td>
165
- </tr>
166
- <tr>
167
- <td align="left">Arborio</td>
168
- <td align="center">Drago<fn reference="a">
169
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
170
- </fn></td>
171
- <td align="center">Balilla<fn reference="a">
172
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
173
- </fn></td>
174
- <td align="center">Thaibonnet</td>
175
- </tr>
176
- </thead>
177
- <tbody>
178
- <tr>
179
- <th align="left">Number of laboratories retained after eliminating outliers</th>
180
- <td align="center">13</td>
181
- <td align="center">11</td>
182
- <td align="center">13</td>
183
- <td align="center">13</td>
184
- </tr>
185
- <tr>
186
- <td align="left">Mean value, g/100 g</td>
187
- <td align="center">81,2</td>
188
- <td align="center">82,0</td>
189
- <td align="center">81,8</td>
190
- <td align="center">77,7</td>
191
- </tr>
192
- </tbody>
193
- <tfoot>
194
- <tr>
195
- <td align="left">Reproducibility limit, <stem type="AsciiMath">R</stem> (= 2,83 <stem type="AsciiMath">s_R</stem>)</td>
196
- <td align="center">2,89</td>
197
- <td align="center">0,57</td>
198
- <td align="center">2,26</td>
199
- <td align="center">6,06</td>
200
- </tr>
201
- </tfoot>
202
- <dl>
203
- <dt>Drago</dt>
204
- <dd>A type of rice</dd>
205
- </dl>
206
- <note><name>NOTE</name><p>This is a table about rice</p></note>
207
- </table>
208
-
209
- <table id="tableD-2" unnumbered="true">
210
- <tbody><tr><td>A</td></tr></tbody>
211
- </table>
212
- </foreword>
213
- </preface>
214
- </iso-standard>
215
- INPUT
154
+ html = <<~OUTPUT
216
155
  #{HTML_HDR}
217
156
  <br/>
218
157
  <div>
@@ -232,11 +171,11 @@ OUTPUT
232
171
  <td colspan="4" style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;" scope="colgroup">Rice sample</td>
233
172
  </tr>
234
173
  <tr>
235
- <td style="text-align:left;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Arborio</td>
236
- <td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Drago<a href="#tableD-1a" class="TableFootnoteRef">a</a><aside class="footnote"><div id="fn:tableD-1a"><span><span id="tableD-1a" class="TableFootnoteRef">a</span>&#160; </span>
174
+ <td style="text-align:left;vertical-align:top;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Arborio</td>
175
+ <td style="text-align:center;vertical-align:middle;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Drago<a href="#tableD-1a" class="TableFootnoteRef">a</a><aside class="footnote"><div id="fn:tableD-1a"><span><span id="tableD-1a" class="TableFootnoteRef">a</span>&#160; </span>
237
176
  <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
238
177
  </div></aside></td>
239
- <td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Balilla<a href="#tableD-1a" class="TableFootnoteRef">a</a></td>
178
+ <td style="text-align:center;vertical-align:bottom;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Balilla<a href="#tableD-1a" class="TableFootnoteRef">a</a></td>
240
179
  <td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Thaibonnet</td>
241
180
  </tr>
242
181
  </thead>
@@ -291,164 +230,324 @@ OUTPUT
291
230
  </body>
292
231
  </html>
293
232
  OUTPUT
294
- end
295
233
 
296
- it "processes IsoXML tables (Word)" do
297
- expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true).gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
298
- <iso-standard xmlns="http://riboseinc.com/isoxml">
299
- <preface>
300
- <foreword>
301
- <table id="tableD-0">
302
- <name>Table 1</name>
303
- <tbody><tr><td>A</td></tr></tbody>
304
- </table>
305
- <table id="tableD-1" alt="tool tip" summary="long desc" width="70%">
306
- <name>Table 2&#xA0;&#x2014; Repeatability and reproducibility of husked rice yield<fn reference="1"><p>X</p></fn></name>
307
- <thead>
308
- <tr>
309
- <td rowspan="2" align="left">Description</td>
310
- <td colspan="4" align="center">Rice sample</td>
311
- </tr>
312
- <tr>
313
- <td align="left">Arborio</td>
314
- <td align="center">Drago<fn reference="a">
315
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
316
- </fn></td>
317
- <td align="center">Balilla<fn reference="a">
318
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
319
- </fn></td>
320
- <td align="center">Thaibonnet</td>
321
- </tr>
322
- </thead>
323
- <tbody>
324
- <tr>
325
- <td align="left">Number of laboratories retained after eliminating outliers</td>
326
- <td align="center">13</td>
327
- <td align="center">11</td>
328
- <td align="center">13</td>
329
- <td align="center">13</td>
330
- </tr>
331
- <tr>
332
- <td align="left">Mean value, g/100 g</td>
333
- <td align="center">81,2</td>
334
- <td align="center">82,0</td>
335
- <td align="center">81,8</td>
336
- <td align="center">77,7</td>
337
- </tr>
338
- </tbody>
339
- <tfoot>
340
- <tr>
341
- <td align="left">Reproducibility limit, <stem type="AsciiMath">R</stem> (= 2,83 <stem type="AsciiMath">s_R</stem>)</td>
342
- <td align="center">2,89</td>
343
- <td align="center">0,57</td>
344
- <td align="center">2,26</td>
345
- <td align="center">6,06</td>
346
- </tr>
347
- </tfoot>
348
- <dl>
349
- <dt>Drago</dt>
350
- <dd>A type of rice</dd>
351
- </dl>
352
- <note><name>NOTE</name><p>This is a table about rice</p></note>
353
- </table>
354
- </foreword>
355
- </preface>
356
- </iso-standard>
357
- INPUT
234
+ word = <<~OUTPUT
358
235
  <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
359
236
  <head><style/></head>
360
- <body lang="EN-US" link="blue" vlink="#954F72">
361
- <div class="WordSection1">
362
- <p>&#160;</p>
363
- </div>
364
- <p><br clear="all" class="section"/></p>
365
- <div class="WordSection2">
366
- <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
367
- <div>
368
- <h1 class="ForewordTitle">Foreword</h1>
369
- <p class="TableTitle" style="text-align:center;">Table 1</p>
370
- <div align="center" class="table_container">
371
- <table id="tableD-0" class="MsoISOTable" style="mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;">
372
- <tbody>
373
- <tr>
374
- <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>
375
- </tr>
376
- </tbody>
377
- </table>
378
- </div>
379
- <p class="TableTitle" style="text-align:center;">Table 2&#160;&#8212; Repeatability and reproducibility of husked rice yield
237
+ <body lang='EN-US' link='blue' vlink='#954F72'>
238
+ <div class='WordSection1'>
239
+ <p>&#160;</p>
240
+ </div>
241
+ <p>
242
+ <br clear='all' class='section'/>
243
+ </p>
244
+ <div class='WordSection2'>
245
+ <p>
246
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
247
+ </p>
248
+ <div>
249
+ <h1 class='ForewordTitle'>Foreword</h1>
250
+ <p class='TableTitle' style='text-align:center;'>
251
+ Table 1&#160;&#8212; Repeatability and reproducibility of
252
+ <i>husked</i>
253
+ rice yield
380
254
  <span style='mso-bookmark:_Ref'>
381
- <a href='#ftn1' epub:type='footnote' class='FootnoteRef'>
382
- <sup>1</sup>
383
- </a>
384
- </span>
385
- </p>
386
- <div align="center" class="table_container">
387
- <table id="tableD-1" class="MsoISOTable" style="mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;" title="tool tip" summary="long desc" width="70%">
255
+ <a class='FootnoteRef' href='#ftn1' epub:type='footnote'>
256
+ <sup>1</sup>
257
+ </a>
258
+ </span>
259
+ </p>
260
+ <div align='center' class='table_container'>
261
+ <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%'>
388
262
  <thead>
389
263
  <tr>
390
- <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>
391
- <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>
264
+ <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>
265
+ <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>
392
266
  </tr>
393
267
  <tr>
394
- <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;">Arborio</td>
395
- <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;">Drago<a href="#tableD-1a" class="TableFootnoteRef">a</a><aside><div id="ftntableD-1a"><span><span id="tableD-1a" class="TableFootnoteRef">a</span><span style="mso-tab-count:1">&#160; </span></span>
396
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
397
- </div></aside></td>
398
- <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;">Balilla<a href="#tableD-1a" class="TableFootnoteRef">a</a></td>
399
- <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>
268
+ <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>
269
+ <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;'>
270
+ Drago
271
+ <a href='#tableD-1a' class='TableFootnoteRef'>a</a>
272
+ <aside>
273
+ <div id='ftntableD-1a'>
274
+ <span>
275
+ <span id='tableD-1a' class='TableFootnoteRef'>a</span>
276
+ <span style='mso-tab-count:1'>&#160; </span>
277
+ </span>
278
+ <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
279
+ </div>
280
+ </aside>
281
+ </td>
282
+ <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;'>
283
+ Balilla
284
+ <a href='#tableD-1a' class='TableFootnoteRef'>a</a>
285
+ </td>
286
+ <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>
400
287
  </tr>
401
288
  </thead>
402
289
  <tbody>
403
290
  <tr>
404
- <td align="left" 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;">Number of laboratories retained after eliminating outliers</td>
405
- <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>
406
- <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>
407
- <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>
408
- <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>
291
+ <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>
292
+ <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>
293
+ <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>
294
+ <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>
295
+ <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>
409
296
  </tr>
410
297
  <tr>
411
- <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>
412
- <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>
413
- <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>
414
- <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>
415
- <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>
298
+ <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>
299
+ <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>
300
+ <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>
301
+ <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>
302
+ <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>
416
303
  </tr>
417
304
  </tbody>
418
305
  <tfoot>
419
306
  <tr>
420
- <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;">Reproducibility limit, <span class="stem">(#(R)#)</span> (= 2,83 <span class="stem">(#(s_R)#)</span>)</td>
421
- <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>
422
- <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>
423
- <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>
424
- <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>
307
+ <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;'>
308
+ Reproducibility limit,
309
+ <span class='stem'>(#(R)#)</span>
310
+ (= 2,83
311
+ <span class='stem'>(#(s_R)#)</span>
312
+ )
313
+ </td>
314
+ <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>
315
+ <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>
316
+ <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>
317
+ <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>
425
318
  </tr>
426
319
  </tfoot>
427
- <table class="dl">
320
+ <table class='dl'>
428
321
  <tr>
429
- <td valign="top" align="left">
430
- <p align="left" style="margin-left:0pt;text-align:left;">Drago</p>
322
+ <td valign='top' align='left'>
323
+ <p align='left' style='margin-left:0pt;text-align:left;'>Drago</p>
431
324
  </td>
432
- <td valign="top">A type of rice</td>
325
+ <td valign='top'>A type of rice</td>
433
326
  </tr>
434
327
  </table>
435
- <div class="Note">
436
- <p class="Note"><span class="note_label">NOTE</span><span style="mso-tab-count:1">&#160; </span>This is a table about rice</p>
328
+ <div class='Note'>
329
+ <p class='Note'>
330
+ <span class='note_label'>NOTE</span>
331
+ <span style='mso-tab-count:1'>&#160; </span>
332
+ This is a table about rice
333
+ </p>
437
334
  </div>
438
335
  </table>
439
- </div>
440
336
  </div>
441
- <p>&#160;</p>
442
- </div>
443
- <p><br clear="all" class="section"/></p>
444
- <div class="WordSection3">
445
- <p class="zzSTDTitle1"/>
446
- <aside id='ftn1'>
447
- <p>X</p>
448
- </aside>
337
+ <div align='center' class='table_container'>
338
+ <table id='tableD-2' class='MsoISOTable' style='mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;'>
339
+ <tbody>
340
+ <tr>
341
+ <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>
342
+ </tr>
343
+ </tbody>
344
+ </table>
345
+ </div>
449
346
  </div>
450
- </body>
347
+ <p>&#160;</p>
348
+ </div>
349
+ <p>
350
+ <br clear='all' class='section'/>
351
+ </p>
352
+ <div class='WordSection3'>
353
+ <p class='zzSTDTitle1'/>
354
+ <aside id='ftn1'>
355
+ <p>X</p>
356
+ </aside>
357
+ </div>
358
+ </body>
451
359
  </html>
452
360
  OUTPUT
361
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
362
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
363
+ expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", presxml, true).gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref"))).to be_equivalent_to xmlpp(word)
453
364
  end
365
+
366
+ it "processes big tables" do
367
+ expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~INPUT, true).gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref"))).to be_equivalent_to xmlpp(<<~OUTPUT)
368
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
369
+ <preface>
370
+ <foreword>
371
+ <table id="tableD-1" alt="tool tip" summary="long desc" width="70%" keep-with-next="true" keep-lines-together="true">
372
+ <name>Repeatability and reproducibility of <em>husked</em> rice yield<fn reference="1"><p>X</p></fn></name>
373
+ <thead>
374
+ <tr>
375
+ <td>
376
+ Description Description Description Description Description Description Description Description Description
377
+ Description Description Description Description Description Description Description Description Description
378
+ Description Description Description Description Description Description Description Description Description
379
+ Description Description Description Description Description Description Description Description Description
380
+ Description Description Description Description Description Description Description Description Description
381
+ Description Description Description Description Description Description Description Description Description
382
+ Description Description Description Description Description Description Description Description Description
383
+ Description Description Description Description Description Description Description Description Description
384
+ Description Description Description Description Description Description Description Description Description
385
+ Description Description Description Description Description Description Description Description Description
386
+ Description Description Description Description Description Description Description Description Description
387
+ Description Description Description Description Description Description Description Description Description
388
+ Description Description Description Description Description Description Description Description Description
389
+ Description Description Description Description Description Description Description Description Description
390
+ Description Description Description Description Description Description Description Description Description
391
+ Description Description Description Description Description Description Description Description Description
392
+ Description Description Description Description Description Description Description Description Description
393
+ Description Description Description Description Description Description Description Description Description
394
+ Description Description Description Description Description Description Description Description Description
395
+ Description Description Description Description Description Description Description Description Description
396
+ Description Description Description Description Description Description Description Description Description
397
+ Description Description Description Description Description Description Description Description Description
398
+ Description Description Description Description Description Description Description Description Description
399
+ Description Description Description Description Description Description Description Description Description
400
+ Description Description Description Description Description Description Description Description Description
401
+ Description Description Description Description Description Description Description Description Description
402
+ Description Description Description Description Description Description Description Description Description
403
+ Description Description Description Description Description Description Description Description Description
404
+ Description Description Description Description Description Description Description Description Description
405
+ Description Description Description Description Description Description Description Description Description
406
+ Description Description Description Description Description Description Description Description Description
407
+ Description Description Description Description Description Description Description Description Description
408
+ Description Description Description Description Description Description Description Description Description
409
+ Description Description Description Description Description Description Description Description Description
410
+ Description Description Description Description Description Description Description Description Description
411
+ Description Description Description Description Description Description Description Description Description
412
+ Description Description Description Description Description Description Description Description Description
413
+ Description Description Description Description Description Description Description Description Description
414
+ Description Description Description Description Description Description Description Description Description
415
+ Description Description Description Description Description Description Description Description Description
416
+ </td>
417
+ <td>Rice sample</td>
418
+ </tr>
419
+ </thead>
420
+ </table>
421
+ </foreword>
422
+ </preface>
423
+ </iso-standard>
424
+ INPUT
425
+ <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
426
+ <head>
427
+ <style>
428
+ </style>
429
+ </head>
430
+ <body lang='EN-US' link='blue' vlink='#954F72'>
431
+ <div class='WordSection1'>
432
+ <p>&#160;</p>
433
+ </div>
434
+ <p>
435
+ <br clear='all' class='section'/>
436
+ </p>
437
+ <div class='WordSection2'>
438
+ <p>
439
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
440
+ </p>
441
+ <div>
442
+ <h1 class='ForewordTitle'>Foreword</h1>
443
+ <p class='TableTitle' style='text-align:center;'>
444
+ Repeatability and reproducibility of
445
+ <i>husked</i>
446
+ rice yield
447
+ <span style='mso-bookmark:_Ref'>
448
+ <a class='FootnoteRef' href='#ftn1' epub:type='footnote'>
449
+ <sup>1</sup>
450
+ </a>
451
+ </span>
452
+ </p>
453
+ <div align='center' class='table_container'>
454
+ <table id='tableD-1' class='MsoISOTableBig' 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%'>
455
+ <thead>
456
+ <tr>
457
+ <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;'>
458
+ Description Description Description Description Description
459
+ Description Description Description Description Description
460
+ Description Description Description Description Description
461
+ Description Description Description Description Description
462
+ Description Description Description Description Description
463
+ Description Description Description Description Description
464
+ Description Description Description Description Description
465
+ Description Description Description Description Description
466
+ Description Description Description Description Description
467
+ Description Description Description Description Description
468
+ Description Description Description Description Description
469
+ Description Description Description Description Description
470
+ Description Description Description Description Description
471
+ Description Description Description Description Description
472
+ Description Description Description Description Description
473
+ Description Description Description Description Description
474
+ Description Description Description Description Description
475
+ Description Description Description Description Description
476
+ Description Description Description Description Description
477
+ Description Description Description Description Description
478
+ Description Description Description Description Description
479
+ Description Description Description Description Description
480
+ Description Description Description Description Description
481
+ Description Description Description Description Description
482
+ Description Description Description Description Description
483
+ Description Description Description Description Description
484
+ Description Description Description Description Description
485
+ Description Description Description Description Description
486
+ Description Description Description Description Description
487
+ Description Description Description Description Description
488
+ Description Description Description Description Description
489
+ Description Description Description Description Description
490
+ Description Description Description Description Description
491
+ Description Description Description Description Description
492
+ Description Description Description Description Description
493
+ Description Description Description Description Description
494
+ Description Description Description Description Description
495
+ Description Description Description Description Description
496
+ Description Description Description Description Description
497
+ Description Description Description Description Description
498
+ Description Description Description Description Description
499
+ Description Description Description Description Description
500
+ Description Description Description Description Description
501
+ Description Description Description Description Description
502
+ Description Description Description Description Description
503
+ Description Description Description Description Description
504
+ Description Description Description Description Description
505
+ Description Description Description Description Description
506
+ Description Description Description Description Description
507
+ Description Description Description Description Description
508
+ Description Description Description Description Description
509
+ Description Description Description Description Description
510
+ Description Description Description Description Description
511
+ Description Description Description Description Description
512
+ Description Description Description Description Description
513
+ Description Description Description Description Description
514
+ Description Description Description Description Description
515
+ Description Description Description Description Description
516
+ Description Description Description Description Description
517
+ Description Description Description Description Description
518
+ Description Description Description Description Description
519
+ Description Description Description Description Description
520
+ Description Description Description Description Description
521
+ Description Description Description Description Description
522
+ Description Description Description Description Description
523
+ Description Description Description Description Description
524
+ Description Description Description Description Description
525
+ Description Description Description Description Description
526
+ Description Description Description Description Description
527
+ Description Description Description Description Description
528
+ Description Description Description Description Description
529
+ Description Description Description Description Description
530
+ </td>
531
+ <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;'>Rice sample</td>
532
+ </tr>
533
+ </thead>
534
+ </table>
535
+ </div>
536
+ </div>
537
+ <p>&#160;</p>
538
+ </div>
539
+ <p>
540
+ <br clear='all' class='section'/>
541
+ </p>
542
+ <div class='WordSection3'>
543
+ <p class='zzSTDTitle1'/>
544
+ <aside id='ftn1'>
545
+ <p>X</p>
546
+ </aside>
547
+ </div>
548
+ </body>
549
+ </html>
550
+ OUTPUT
551
+ end
552
+
454
553
  end