isodoc 1.1.4 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc-yaml/i18n-en.yaml +4 -1
  3. data/lib/isodoc-yaml/i18n-fr.yaml +4 -1
  4. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +4 -1
  5. data/lib/isodoc.rb +1 -0
  6. data/lib/isodoc/base_style/metanorma_word.css +6 -0
  7. data/lib/isodoc/base_style/metanorma_word.scss +6 -0
  8. data/lib/isodoc/common.rb +0 -2
  9. data/lib/isodoc/convert.rb +34 -28
  10. data/lib/isodoc/function/blocks.rb +11 -22
  11. data/lib/isodoc/function/blocks_example_note.rb +14 -15
  12. data/lib/isodoc/function/cleanup.rb +5 -4
  13. data/lib/isodoc/function/inline.rb +6 -76
  14. data/lib/isodoc/function/references.rb +13 -10
  15. data/lib/isodoc/function/reqt.rb +12 -11
  16. data/lib/isodoc/function/section.rb +51 -54
  17. data/lib/isodoc/function/table.rb +2 -6
  18. data/lib/isodoc/function/terms.rb +13 -6
  19. data/lib/isodoc/function/to_word_html.rb +3 -0
  20. data/lib/isodoc/function/utils.rb +6 -5
  21. data/lib/isodoc/html_function/html.rb +1 -1
  22. data/lib/isodoc/{function/i18n.rb → i18n.rb} +37 -37
  23. data/lib/isodoc/metadata.rb +4 -3
  24. data/lib/isodoc/metadata_date.rb +1 -1
  25. data/lib/isodoc/presentation_function/block.rb +152 -0
  26. data/lib/isodoc/presentation_function/inline.rb +131 -0
  27. data/lib/isodoc/presentation_function/section.rb +46 -0
  28. data/lib/isodoc/presentation_xml_convert.rb +39 -5
  29. data/lib/isodoc/version.rb +1 -1
  30. data/lib/isodoc/word_function/body.rb +13 -8
  31. data/lib/isodoc/word_function/inline.rb +3 -1
  32. data/lib/isodoc/word_function/postprocess.rb +1 -1
  33. data/lib/isodoc/word_function/table.rb +3 -2
  34. data/lib/isodoc/xref.rb +6 -3
  35. data/lib/isodoc/xref/xref_counter.rb +21 -7
  36. data/lib/isodoc/xref/xref_gen.rb +27 -4
  37. data/lib/isodoc/xref/xref_sect_gen.rb +3 -3
  38. data/spec/assets/i18n.yaml +12 -1
  39. data/spec/isodoc/blocks_spec.rb +1338 -147
  40. data/spec/isodoc/cleanup_spec.rb +5 -3
  41. data/spec/isodoc/footnotes_spec.rb +2 -2
  42. data/spec/isodoc/i18n_spec.rb +679 -110
  43. data/spec/isodoc/inline_spec.rb +323 -142
  44. data/spec/isodoc/lists_spec.rb +2 -2
  45. data/spec/isodoc/postproc_spec.rb +1347 -1333
  46. data/spec/isodoc/ref_spec.rb +181 -3
  47. data/spec/isodoc/section_spec.rb +633 -681
  48. data/spec/isodoc/table_spec.rb +386 -136
  49. data/spec/isodoc/terms_spec.rb +111 -79
  50. data/spec/isodoc/xref_spec.rb +1597 -1186
  51. metadata +6 -3
@@ -1,8 +1,8 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
- it "processes IsoXML tables" do
5
- expect(xmlpp(IsoDoc::HtmlConvert.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>
@@ -63,6 +63,95 @@ RSpec.describe IsoDoc do
63
63
  </preface>
64
64
  </iso-standard>
65
65
  INPUT
66
+
67
+ presxml = <<~OUTPUT
68
+ <iso-standard xmlns='http://riboseinc.com/isoxml'>
69
+ <preface>
70
+ <foreword>
71
+ <table id='tableD-1' alt='tool tip' summary='long desc' width='70%' keep-with-next='true' keep-lines-together='true'>
72
+ <name>
73
+ Table 1&#xA0;&#x2014; Repeatability and reproducibility of
74
+ <em>husked</em>
75
+ rice yield
76
+ <fn reference='1'>
77
+ <p>X</p>
78
+ </fn>
79
+ </name>
80
+ <thead>
81
+ <tr>
82
+ <td rowspan='2' align='left'>Description</td>
83
+ <td colspan='4' align='center'>Rice sample</td>
84
+ </tr>
85
+ <tr>
86
+ <td valign="top" align='left'>Arborio</td>
87
+ <td valign="middle" align='center'>
88
+ Drago
89
+ <fn reference='a'>
90
+ <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
91
+ </fn>
92
+ </td>
93
+ <td valign="bottom" align='center'>
94
+ Balilla
95
+ <fn reference='a'>
96
+ <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
97
+ </fn>
98
+ </td>
99
+ <td align='center'>Thaibonnet</td>
100
+ </tr>
101
+ </thead>
102
+ <tbody>
103
+ <tr>
104
+ <th align='left'>Number of laboratories retained after eliminating outliers</th>
105
+ <td align='center'>13</td>
106
+ <td align='center'>11</td>
107
+ <td align='center'>13</td>
108
+ <td align='center'>13</td>
109
+ </tr>
110
+ <tr>
111
+ <td align='left'>Mean value, g/100 g</td>
112
+ <td align='center'>81,2</td>
113
+ <td align='center'>82,0</td>
114
+ <td align='center'>81,8</td>
115
+ <td align='center'>77,7</td>
116
+ </tr>
117
+ </tbody>
118
+ <tfoot>
119
+ <tr>
120
+ <td align='left'>
121
+ Reproducibility limit,
122
+ <stem type='AsciiMath'>R</stem>
123
+ (= 2,83
124
+ <stem type='AsciiMath'>s_R</stem>
125
+ )
126
+ </td>
127
+ <td align='center'>2,89</td>
128
+ <td align='center'>0,57</td>
129
+ <td align='center'>2,26</td>
130
+ <td align='center'>6,06</td>
131
+ </tr>
132
+ </tfoot>
133
+ <dl>
134
+ <dt>Drago</dt>
135
+ <dd>A type of rice</dd>
136
+ </dl>
137
+ <note>
138
+ <name>NOTE</name>
139
+ <p>This is a table about rice</p>
140
+ </note>
141
+ </table>
142
+ <table id='tableD-2' unnumbered='true'>
143
+ <tbody>
144
+ <tr>
145
+ <td>A</td>
146
+ </tr>
147
+ </tbody>
148
+ </table>
149
+ </foreword>
150
+ </preface>
151
+ </iso-standard>
152
+ OUTPUT
153
+
154
+ html = <<~OUTPUT
66
155
  #{HTML_HDR}
67
156
  <br/>
68
157
  <div>
@@ -82,11 +171,11 @@ RSpec.describe IsoDoc do
82
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>
83
172
  </tr>
84
173
  <tr>
85
- <td style="text-align:left;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Arborio</td>
86
- <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>
87
176
  <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
88
177
  </div></aside></td>
89
- <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>
90
179
  <td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Thaibonnet</td>
91
180
  </tr>
92
181
  </thead>
@@ -141,163 +230,324 @@ RSpec.describe IsoDoc do
141
230
  </body>
142
231
  </html>
143
232
  OUTPUT
144
- end
145
233
 
146
- it "processes IsoXML tables (Word)" do
147
- expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true).gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
148
- <iso-standard xmlns="http://riboseinc.com/isoxml">
149
- <preface>
150
- <foreword>
151
- <table id="tableD-0">
152
- <tbody><tr><td>A</td></tr></tbody>
153
- </table>
154
- <table id="tableD-1" alt="tool tip" summary="long desc" width="70%">
155
- <name>Repeatability and reproducibility of husked rice yield<fn reference="1"><p>X</p></fn></name>
156
- <thead>
157
- <tr>
158
- <td rowspan="2" align="left">Description</td>
159
- <td colspan="4" align="center">Rice sample</td>
160
- </tr>
161
- <tr>
162
- <td align="left">Arborio</td>
163
- <td align="center">Drago<fn reference="a">
164
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
165
- </fn></td>
166
- <td align="center">Balilla<fn reference="a">
167
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
168
- </fn></td>
169
- <td align="center">Thaibonnet</td>
170
- </tr>
171
- </thead>
172
- <tbody>
173
- <tr>
174
- <td align="left">Number of laboratories retained after eliminating outliers</td>
175
- <td align="center">13</td>
176
- <td align="center">11</td>
177
- <td align="center">13</td>
178
- <td align="center">13</td>
179
- </tr>
180
- <tr>
181
- <td align="left">Mean value, g/100 g</td>
182
- <td align="center">81,2</td>
183
- <td align="center">82,0</td>
184
- <td align="center">81,8</td>
185
- <td align="center">77,7</td>
186
- </tr>
187
- </tbody>
188
- <tfoot>
189
- <tr>
190
- <td align="left">Reproducibility limit, <stem type="AsciiMath">R</stem> (= 2,83 <stem type="AsciiMath">s_R</stem>)</td>
191
- <td align="center">2,89</td>
192
- <td align="center">0,57</td>
193
- <td align="center">2,26</td>
194
- <td align="center">6,06</td>
195
- </tr>
196
- </tfoot>
197
- <dl>
198
- <dt>Drago</dt>
199
- <dd>A type of rice</dd>
200
- </dl>
201
- <note><p>This is a table about rice</p></note>
202
- </table>
203
- </foreword>
204
- </preface>
205
- </iso-standard>
206
- INPUT
234
+ word = <<~OUTPUT
207
235
  <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
208
236
  <head><style/></head>
209
- <body lang="EN-US" link="blue" vlink="#954F72">
210
- <div class="WordSection1">
211
- <p>&#160;</p>
212
- </div>
213
- <p><br clear="all" class="section"/></p>
214
- <div class="WordSection2">
215
- <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
216
- <div>
217
- <h1 class="ForewordTitle">Foreword</h1>
218
- <p class="TableTitle" style="text-align:center;">Table 1</p>
219
- <div align="center" class="table_container">
220
- <table id="tableD-0" class="MsoISOTable" style="mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;">
221
- <tbody>
222
- <tr>
223
- <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>
224
- </tr>
225
- </tbody>
226
- </table>
227
- </div>
228
- <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
229
254
  <span style='mso-bookmark:_Ref'>
230
- <a href='#ftn1' epub:type='footnote' class='FootnoteRef'>
231
- <sup>1</sup>
232
- </a>
233
- </span>
234
- </p>
235
- <div align="center" class="table_container">
236
- <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%'>
237
262
  <thead>
238
263
  <tr>
239
- <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>
240
- <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>
241
266
  </tr>
242
267
  <tr>
243
- <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>
244
- <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>
245
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
246
- </div></aside></td>
247
- <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>
248
- <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>
249
287
  </tr>
250
288
  </thead>
251
289
  <tbody>
252
290
  <tr>
253
- <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>
254
- <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>
255
- <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>
256
- <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>
257
- <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>
258
296
  </tr>
259
297
  <tr>
260
- <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>
261
- <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>
262
- <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>
263
- <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>
264
- <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>
265
303
  </tr>
266
304
  </tbody>
267
305
  <tfoot>
268
306
  <tr>
269
- <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>
270
- <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>
271
- <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>
272
- <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>
273
- <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>
274
318
  </tr>
275
319
  </tfoot>
276
- <table class="dl">
320
+ <table class='dl'>
277
321
  <tr>
278
- <td valign="top" align="left">
279
- <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>
280
324
  </td>
281
- <td valign="top">A type of rice</td>
325
+ <td valign='top'>A type of rice</td>
282
326
  </tr>
283
327
  </table>
284
- <div class="Note">
285
- <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>
286
334
  </div>
287
335
  </table>
288
- </div>
289
336
  </div>
290
- <p>&#160;</p>
291
- </div>
292
- <p><br clear="all" class="section"/></p>
293
- <div class="WordSection3">
294
- <p class="zzSTDTitle1"/>
295
- <aside id='ftn1'>
296
- <p>X</p>
297
- </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>
298
346
  </div>
299
- </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>
300
359
  </html>
301
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)
302
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
+
303
553
  end