isodoc 1.5.5 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,581 +1,591 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
- it "processes IsoXML tables" do
5
- input = <<~INPUT
6
- <iso-standard xmlns="http://riboseinc.com/isoxml">
7
- <preface>
8
- <foreword>
9
- <table id="tableD-1" alt="tool tip" summary="long desc" width="70%" keep-with-next="true" keep-lines-together="true">
10
- <name>Repeatability and reproducibility of <em>husked</em> rice yield<fn reference="1"><p>X</p></fn></name>
11
- <colgroup>
12
- <col width="30%"/>
13
- <col width="20%"/>
14
- <col width="20%"/>
15
- <col width="20%"/>
16
- <col width="10%"/>
17
- </colgroup>
18
- <thead>
19
- <tr>
20
- <td rowspan="2" align="left">Description</td>
21
- <td colspan="4" align="center">Rice sample</td>
22
- </tr>
23
- <tr>
24
- <td valign="top" align="left">Arborio</td>
25
- <td valign="middle" align="center">Drago<fn reference="a">
26
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
27
- </fn></td>
28
- <td valign="bottom" align="center">Balilla<fn reference="a">
29
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
30
- </fn></td>
31
- <td align="center">Thaibonnet</td>
32
- </tr>
33
- </thead>
34
- <tbody>
35
- <tr>
36
- <th align="left">Number of laboratories retained after eliminating outliers</th>
37
- <td align="center">13</td>
38
- <td align="center">11</td>
39
- <td align="center">13</td>
40
- <td align="center">13</td>
41
- </tr>
42
- <tr>
43
- <td align="left">Mean value, g/100 g</td>
44
- <td align="center">81,2</td>
45
- <td align="center">82,0</td>
46
- <td align="center">81,8</td>
47
- <td align="center">77,7</td>
48
- </tr>
49
- </tbody>
50
- <tfoot>
51
- <tr>
52
- <td align="left">Reproducibility limit, <stem type="AsciiMath">R</stem> (= 2,83 <stem type="AsciiMath">s_R</stem>)</td>
53
- <td align="center">2,89</td>
54
- <td align="center">0,57</td>
55
- <td align="center">2,26</td>
56
- <td align="center">6,06</td>
57
- </tr>
58
- </tfoot>
59
- <dl>
60
- <dt>Drago</dt>
61
- <dd>A type of rice</dd>
62
- </dl>
63
- <note><p>This is a table about rice</p></note>
64
- </table>
65
-
66
- <table id="tableD-2" unnumbered="true">
67
- <tbody><tr><td>A</td></tr></tbody>
68
- </table>
69
- </foreword>
70
- </preface>
71
- </iso-standard>
4
+ it "processes IsoXML tables" do
5
+ input = <<~INPUT
6
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ <preface>
8
+ <foreword>
9
+ <table id="tableD-1" alt="tool tip" summary="long desc" width="70%" keep-with-next="true" keep-lines-together="true">
10
+ <name>Repeatability and reproducibility of <em>husked</em> rice yield<fn reference="1"><p>X</p></fn></name>
11
+ <colgroup>
12
+ <col width="30%"/>
13
+ <col width="20%"/>
14
+ <col width="20%"/>
15
+ <col width="20%"/>
16
+ <col width="10%"/>
17
+ </colgroup>
18
+ <thead>
19
+ <tr>
20
+ <td rowspan="2" align="left">Description</td>
21
+ <td colspan="4" align="center">Rice sample</td>
22
+ </tr>
23
+ <tr>
24
+ <td valign="top" align="left">Arborio</td>
25
+ <td valign="middle" align="center">Drago<fn reference="a">
26
+ <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
27
+ </fn></td>
28
+ <td valign="bottom" align="center">Balilla<fn reference="a">
29
+ <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
30
+ </fn></td>
31
+ <td align="center">Thaibonnet</td>
32
+ </tr>
33
+ </thead>
34
+ <tbody>
35
+ <tr>
36
+ <th align="left">Number of laboratories retained after eliminating outliers</th>
37
+ <td align="center">13</td>
38
+ <td align="center">11</td>
39
+ <td align="center">13</td>
40
+ <td align="center">13</td>
41
+ </tr>
42
+ <tr>
43
+ <td align="left">Mean value, g/100 g</td>
44
+ <td align="center">81,2</td>
45
+ <td align="center">82,0</td>
46
+ <td align="center">81,8</td>
47
+ <td align="center">77,7</td>
48
+ </tr>
49
+ </tbody>
50
+ <tfoot>
51
+ <tr>
52
+ <td align="left">Reproducibility limit, <stem type="AsciiMath">R</stem> (= 2,83 <stem type="AsciiMath">s_R</stem>)</td>
53
+ <td align="center">2,89</td>
54
+ <td align="center">0,57</td>
55
+ <td align="center">2,26</td>
56
+ <td align="center">6,06</td>
57
+ </tr>
58
+ </tfoot>
59
+ <dl>
60
+ <dt>Drago</dt>
61
+ <dd>A type of rice</dd>
62
+ </dl>
63
+ <note><p>This is a table about rice</p></note>
64
+ </table>
65
+ #{' '}
66
+ <table id="tableD-2" unnumbered="true">
67
+ <tbody><tr><td>A</td></tr></tbody>
68
+ </table>
69
+ </foreword>
70
+ </preface>
71
+ </iso-standard>
72
72
  INPUT
73
73
 
74
74
  presxml = <<~OUTPUT
75
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
76
- <preface>
77
- <foreword>
78
- <table id='tableD-1' alt='tool tip' summary='long desc' width='70%' keep-with-next='true' keep-lines-together='true'>
79
- <name>
80
- Table 1&#xA0;&#x2014; Repeatability and reproducibility of
81
- <em>husked</em>
82
- rice yield
83
- <fn reference='1'>
84
- <p>X</p>
85
- </fn>
86
- </name>
87
- <colgroup>
88
- <col width='30%'/>
89
- <col width='20%'/>
90
- <col width='20%'/>
91
- <col width='20%'/>
92
- <col width='10%'/>
93
- </colgroup>
94
- <thead>
95
- <tr>
96
- <td rowspan='2' align='left'>Description</td>
97
- <td colspan='4' align='center'>Rice sample</td>
98
- </tr>
99
- <tr>
100
- <td valign="top" align='left'>Arborio</td>
101
- <td valign="middle" align='center'>
102
- Drago
103
- <fn reference='a'>
104
- <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
105
- </fn>
106
- </td>
107
- <td valign="bottom" align='center'>
108
- Balilla
109
- <fn reference='a'>
110
- <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
111
- </fn>
112
- </td>
113
- <td align='center'>Thaibonnet</td>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr>
118
- <th align='left'>Number of laboratories retained after eliminating outliers</th>
119
- <td align='center'>13</td>
120
- <td align='center'>11</td>
121
- <td align='center'>13</td>
122
- <td align='center'>13</td>
123
- </tr>
124
- <tr>
125
- <td align='left'>Mean value, g/100 g</td>
126
- <td align='center'>81,2</td>
127
- <td align='center'>82,0</td>
128
- <td align='center'>81,8</td>
129
- <td align='center'>77,7</td>
130
- </tr>
131
- </tbody>
132
- <tfoot>
133
- <tr>
134
- <td align='left'>
135
- Reproducibility limit,
136
- <stem type='AsciiMath'>R</stem>
137
- (= 2,83
138
- <stem type='AsciiMath'>s_R</stem>
139
- )
140
- </td>
141
- <td align='center'>2,89</td>
142
- <td align='center'>0,57</td>
143
- <td align='center'>2,26</td>
144
- <td align='center'>6,06</td>
145
- </tr>
146
- </tfoot>
147
- <dl>
148
- <dt>Drago</dt>
149
- <dd>A type of rice</dd>
150
- </dl>
151
- <note>
152
- <name>NOTE</name>
153
- <p>This is a table about rice</p>
154
- </note>
155
- </table>
156
- <table id='tableD-2' unnumbered='true'>
157
- <tbody>
158
- <tr>
159
- <td>A</td>
160
- </tr>
161
- </tbody>
162
- </table>
163
- </foreword>
164
- </preface>
165
- </iso-standard>
166
- OUTPUT
75
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
76
+ <preface>
77
+ <foreword>
78
+ <table id='tableD-1' alt='tool tip' summary='long desc' width='70%' keep-with-next='true' keep-lines-together='true'>
79
+ <name>
80
+ Table 1&#xA0;&#x2014; Repeatability and reproducibility of
81
+ <em>husked</em>
82
+ rice yield
83
+ <fn reference='1'>
84
+ <p>X</p>
85
+ </fn>
86
+ </name>
87
+ <colgroup>
88
+ <col width='30%'/>
89
+ <col width='20%'/>
90
+ <col width='20%'/>
91
+ <col width='20%'/>
92
+ <col width='10%'/>
93
+ </colgroup>
94
+ <thead>
95
+ <tr>
96
+ <td rowspan='2' align='left'>Description</td>
97
+ <td colspan='4' align='center'>Rice sample</td>
98
+ </tr>
99
+ <tr>
100
+ <td valign="top" align='left'>Arborio</td>
101
+ <td valign="middle" align='center'>
102
+ Drago
103
+ <fn reference='a'>
104
+ <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
105
+ </fn>
106
+ </td>
107
+ <td valign="bottom" align='center'>
108
+ Balilla
109
+ <fn reference='a'>
110
+ <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
111
+ </fn>
112
+ </td>
113
+ <td align='center'>Thaibonnet</td>
114
+ </tr>
115
+ </thead>
116
+ <tbody>
117
+ <tr>
118
+ <th align='left'>Number of laboratories retained after eliminating outliers</th>
119
+ <td align='center'>13</td>
120
+ <td align='center'>11</td>
121
+ <td align='center'>13</td>
122
+ <td align='center'>13</td>
123
+ </tr>
124
+ <tr>
125
+ <td align='left'>Mean value, g/100 g</td>
126
+ <td align='center'>81,2</td>
127
+ <td align='center'>82,0</td>
128
+ <td align='center'>81,8</td>
129
+ <td align='center'>77,7</td>
130
+ </tr>
131
+ </tbody>
132
+ <tfoot>
133
+ <tr>
134
+ <td align='left'>
135
+ Reproducibility limit,
136
+ <stem type='AsciiMath'>R</stem>
137
+ (= 2,83
138
+ <stem type='AsciiMath'>s_R</stem>
139
+ )
140
+ </td>
141
+ <td align='center'>2,89</td>
142
+ <td align='center'>0,57</td>
143
+ <td align='center'>2,26</td>
144
+ <td align='center'>6,06</td>
145
+ </tr>
146
+ </tfoot>
147
+ <dl>
148
+ <dt>Drago</dt>
149
+ <dd>A type of rice</dd>
150
+ </dl>
151
+ <note>
152
+ <name>NOTE</name>
153
+ <p>This is a table about rice</p>
154
+ </note>
155
+ </table>
156
+ <table id='tableD-2' unnumbered='true'>
157
+ <tbody>
158
+ <tr>
159
+ <td>A</td>
160
+ </tr>
161
+ </tbody>
162
+ </table>
163
+ </foreword>
164
+ </preface>
165
+ </iso-standard>
166
+ OUTPUT
167
167
 
168
- html = <<~OUTPUT
169
- #{HTML_HDR}
170
- <br/>
171
- <div>
172
- <h1 class="ForewordTitle">Foreword</h1>
173
- <p class="TableTitle" style="text-align:center;">Table 1&#160;&#8212; Repeatability and reproducibility of <i>husked</i> rice yield
174
- <a class='FootnoteRef' href='#fn:1'>
175
- <sup>1</sup>
176
- </a>
177
- </p>
178
- <table id="tableD-1" class="MsoISOTable" style="border-width:1px;border-spacing:0;width:70%;page-break-after: avoid;page-break-inside: avoid;" title="tool tip" >
179
- <caption>
180
- <span style="display:none">long desc</span>
181
- </caption>
182
- <colgroup>
183
- <col style='width: 30%;'/>
184
- <col style='width: 20%;'/>
185
- <col style='width: 20%;'/>
186
- <col style='width: 20%;'/>
187
- <col style='width: 10%;'/>
188
- </colgroup>
189
- <thead>
190
- <tr>
191
- <td rowspan="2" style="text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;" scope="col">Description</td>
192
- <td colspan="4" style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;" scope="colgroup">Rice sample</td>
193
- </tr>
194
- <tr>
195
- <td style="text-align:left;vertical-align:top;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Arborio</td>
196
- <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>
197
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
198
- </div></aside></td>
199
- <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>
200
- <td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Thaibonnet</td>
201
- </tr>
202
- </thead>
203
- <tbody>
204
- <tr>
205
- <th style="font-weight:bold;text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;" scope="row">Number of laboratories retained after eliminating outliers</th>
206
- <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;">13</td>
207
- <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;">11</td>
208
- <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;">13</td>
209
- <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;">13</td>
210
- </tr>
211
- <tr>
212
- <td style="text-align:left;border-top:none;border-bottom:solid windowtext 1.5pt;">Mean value, g/100 g</td>
213
- <td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;">81,2</td>
214
- <td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;">82,0</td>
215
- <td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;">81,8</td>
216
- <td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;">77,7</td>
217
- </tr>
218
- </tbody>
219
- <tfoot>
220
- <tr>
221
- <td style="text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Reproducibility limit, <span class="stem">(#(R)#)</span> (= 2,83 <span class="stem">(#(s_R)#)</span>)</td>
222
- <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">2,89</td>
223
- <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">0,57</td>
224
- <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">2,26</td>
225
- <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">6,06</td>
226
- </tr>
227
- </tfoot>
228
- <dl>
229
- <dt>
230
- <p>Drago</p>
231
- </dt>
232
- <dd>A type of rice</dd>
233
- </dl>
234
- <div class="Note">
235
- <p><span class="note_label">NOTE</span>&#160; This is a table about rice</p>
168
+ html = <<~OUTPUT
169
+ #{HTML_HDR}
170
+ <br/>
171
+ <div>
172
+ <h1 class="ForewordTitle">Foreword</h1>
173
+ <p class="TableTitle" style="text-align:center;">Table 1&#160;&#8212; Repeatability and reproducibility of <i>husked</i> rice yield
174
+ <a class='FootnoteRef' href='#fn:1'>
175
+ <sup>1</sup>
176
+ </a>
177
+ </p>
178
+ <table id="tableD-1" class="MsoISOTable" style="border-width:1px;border-spacing:0;width:70%;page-break-after: avoid;page-break-inside: avoid;" title="tool tip" >
179
+ <caption>
180
+ <span style="display:none">long desc</span>
181
+ </caption>
182
+ <colgroup>
183
+ <col style='width: 30%;'/>
184
+ <col style='width: 20%;'/>
185
+ <col style='width: 20%;'/>
186
+ <col style='width: 20%;'/>
187
+ <col style='width: 10%;'/>
188
+ </colgroup>
189
+ <thead>
190
+ <tr>
191
+ <td rowspan="2" style="text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;" scope="col">Description</td>
192
+ <td colspan="4" style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;" scope="colgroup">Rice sample</td>
193
+ </tr>
194
+ <tr>
195
+ <td style="text-align:left;vertical-align:top;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Arborio</td>
196
+ <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>
197
+ <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
198
+ </div></aside></td>
199
+ <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>
200
+ <td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Thaibonnet</td>
201
+ </tr>
202
+ </thead>
203
+ <tbody>
204
+ <tr>
205
+ <th style="font-weight:bold;text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;" scope="row">Number of laboratories retained after eliminating outliers</th>
206
+ <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;">13</td>
207
+ <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;">11</td>
208
+ <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;">13</td>
209
+ <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;">13</td>
210
+ </tr>
211
+ <tr>
212
+ <td style="text-align:left;border-top:none;border-bottom:solid windowtext 1.5pt;">Mean value, g/100 g</td>
213
+ <td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;">81,2</td>
214
+ <td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;">82,0</td>
215
+ <td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;">81,8</td>
216
+ <td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;">77,7</td>
217
+ </tr>
218
+ </tbody>
219
+ <tfoot>
220
+ <tr>
221
+ <td style="text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">Reproducibility limit, <span class="stem">(#(R)#)</span> (= 2,83 <span class="stem">(#(s_R)#)</span>)</td>
222
+ <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">2,89</td>
223
+ <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">0,57</td>
224
+ <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">2,26</td>
225
+ <td style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">6,06</td>
226
+ </tr>
227
+ </tfoot>
228
+ <dl>
229
+ <dt>
230
+ <p>Drago</p>
231
+ </dt>
232
+ <dd>A type of rice</dd>
233
+ </dl>
234
+ <div class="Note">
235
+ <p><span class="note_label">NOTE</span>&#160; This is a table about rice</p>
236
+ </div>
237
+ </table>
238
+ <table id="tableD-2" class="MsoISOTable" style="border-width:1px;border-spacing:0;">
239
+ <tbody>
240
+ <tr>
241
+ <td style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">A</td>
242
+ </tr>
243
+ </tbody>
244
+ </table>
245
+ </div>
246
+ <p class="zzSTDTitle1"/>
247
+ <aside id='fn:1' class='footnote'>
248
+ <p>X</p>
249
+ </aside>
236
250
  </div>
237
- </table>
238
- <table id="tableD-2" class="MsoISOTable" style="border-width:1px;border-spacing:0;">
239
- <tbody>
240
- <tr>
241
- <td style="border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;">A</td>
242
- </tr>
243
- </tbody>
244
- </table>
245
- </div>
246
- <p class="zzSTDTitle1"/>
247
- <aside id='fn:1' class='footnote'>
248
- <p>X</p>
249
- </aside>
250
- </div>
251
- </body>
252
- </html>
251
+ </body>
252
+ </html>
253
253
  OUTPUT
254
254
 
255
255
  word = <<~OUTPUT
256
- <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
257
- <head><style/></head>
258
- <body lang='EN-US' link='blue' vlink='#954F72'>
259
- <div class='WordSection1'>
260
- <p>&#160;</p>
261
- </div>
262
- <p>
263
- <br clear='all' class='section'/>
264
- </p>
265
- <div class='WordSection2'>
266
- <p>
267
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
268
- </p>
269
- <div>
270
- <h1 class='ForewordTitle'>Foreword</h1>
271
- <p class='TableTitle' style='text-align:center;'>
272
- Table 1&#160;&#8212; Repeatability and reproducibility of
273
- <i>husked</i>
274
- rice yield
275
- <span style='mso-bookmark:_Ref'>
276
- <a class='FootnoteRef' href='#ftn1' epub:type='footnote'>
277
- <sup>1</sup>
278
- </a>
279
- </span>
280
- </p>
281
- <div align='center' class='table_container'>
282
- <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%'>
283
- <colgroup>
284
- <col width='30%'/>
285
- <col width='20%'/>
286
- <col width='20%'/>
287
- <col width='20%'/>
288
- <col width='10%'/>
289
- </colgroup>
290
- <thead>
291
- <tr>
292
- <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>
293
- <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>
294
- </tr>
295
- <tr>
296
- <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>
297
- <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;'>
298
- Drago
299
- <a href='#tableD-1a' class='TableFootnoteRef'>a</a>
300
- <aside>
301
- <div id='ftntableD-1a'>
302
- <span>
303
- <span id='tableD-1a' class='TableFootnoteRef'>a</span>
304
- <span style='mso-tab-count:1'>&#160; </span>
305
- </span>
306
- <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
307
- </div>
308
- </aside>
309
- </td>
310
- <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;'>
311
- Balilla
312
- <a href='#tableD-1a' class='TableFootnoteRef'>a</a>
313
- </td>
314
- <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>
315
- </tr>
316
- </thead>
317
- <tbody>
318
- <tr>
319
- <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>
320
- <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>
321
- <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>
322
- <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>
323
- <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>
324
- </tr>
325
- <tr>
326
- <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>
327
- <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>
328
- <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>
329
- <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>
330
- <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>
331
- </tr>
332
- </tbody>
333
- <tfoot>
334
- <tr>
335
- <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;'>
336
- Reproducibility limit,
337
- <span class='stem'>(#(R)#)</span>
338
- (= 2,83
339
- <span class='stem'>(#(s_R)#)</span>
340
- )
341
- </td>
342
- <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>
343
- <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>
344
- <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>
345
- <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>
346
- </tr>
347
- </tfoot>
348
- <table class='dl'>
349
- <tr>
350
- <td valign='top' align='left'>
351
- <p align='left' style='margin-left:0pt;text-align:left;'>Drago</p>
352
- </td>
353
- <td valign='top'>A type of rice</td>
354
- </tr>
355
- </table>
356
- <div class='Note'>
357
- <p class='Note'>
358
- <span class='note_label'>NOTE</span>
359
- <span style='mso-tab-count:1'>&#160; </span>
360
- This is a table about rice
256
+ <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
257
+ <head><style/></head>
258
+ <body lang='EN-US' link='blue' vlink='#954F72'>
259
+ <div class='WordSection1'>
260
+ <p>&#160;</p>
261
+ </div>
262
+ <p>
263
+ <br clear='all' class='section'/>
264
+ </p>
265
+ <div class='WordSection2'>
266
+ <p>
267
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
268
+ </p>
269
+ <div>
270
+ <h1 class='ForewordTitle'>Foreword</h1>
271
+ <p class='TableTitle' style='text-align:center;'>
272
+ Table 1&#160;&#8212; Repeatability and reproducibility of
273
+ <i>husked</i>
274
+ rice yield
275
+ <span style='mso-bookmark:_Ref'>
276
+ <a class='FootnoteRef' href='#ftn1' epub:type='footnote'>
277
+ <sup>1</sup>
278
+ </a>
279
+ </span>
361
280
  </p>
281
+ <div align='center' class='table_container'>
282
+ <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%'>
283
+ <colgroup>
284
+ <col width='30%'/>
285
+ <col width='20%'/>
286
+ <col width='20%'/>
287
+ <col width='20%'/>
288
+ <col width='10%'/>
289
+ </colgroup>
290
+ <thead>
291
+ <tr>
292
+ <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>
293
+ <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>
294
+ </tr>
295
+ <tr>
296
+ <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>
297
+ <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;'>
298
+ Drago
299
+ <a href='#tableD-1a' class='TableFootnoteRef'>a</a>
300
+ <aside>
301
+ <div id='ftntableD-1a'>
302
+ <span>
303
+ <span id='tableD-1a' class='TableFootnoteRef'>a</span>
304
+ <span style='mso-tab-count:1'>&#160; </span>
305
+ </span>
306
+ <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
307
+ </div>
308
+ </aside>
309
+ </td>
310
+ <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;'>
311
+ Balilla
312
+ <a href='#tableD-1a' class='TableFootnoteRef'>a</a>
313
+ </td>
314
+ <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>
315
+ </tr>
316
+ </thead>
317
+ <tbody>
318
+ <tr>
319
+ <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>
320
+ <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>
321
+ <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>
322
+ <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>
323
+ <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>
324
+ </tr>
325
+ <tr>
326
+ <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>
327
+ <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>
328
+ <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>
329
+ <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>
330
+ <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>
331
+ </tr>
332
+ </tbody>
333
+ <tfoot>
334
+ <tr>
335
+ <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;'>
336
+ Reproducibility limit,
337
+ <span class='stem'>(#(R)#)</span>
338
+ (= 2,83
339
+ <span class='stem'>(#(s_R)#)</span>
340
+ )
341
+ </td>
342
+ <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>
343
+ <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>
344
+ <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>
345
+ <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>
346
+ </tr>
347
+ </tfoot>
348
+ <table class='dl'>
349
+ <tr>
350
+ <td valign='top' align='left'>
351
+ <p align='left' style='margin-left:0pt;text-align:left;'>Drago</p>
352
+ </td>
353
+ <td valign='top'>A type of rice</td>
354
+ </tr>
355
+ </table>
356
+ <div class='Note'>
357
+ <p class='Note'>
358
+ <span class='note_label'>NOTE</span>
359
+ <span style='mso-tab-count:1'>&#160; </span>
360
+ This is a table about rice
361
+ </p>
362
+ </div>
363
+ </table>
364
+ </div>
365
+ <div align='center' class='table_container'>
366
+ <table id='tableD-2' class='MsoISOTable' style='mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;'>
367
+ <tbody>
368
+ <tr>
369
+ <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>
370
+ </tr>
371
+ </tbody>
372
+ </table>
373
+ </div>
362
374
  </div>
363
- </table>
364
- </div>
365
- <div align='center' class='table_container'>
366
- <table id='tableD-2' class='MsoISOTable' style='mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;'>
367
- <tbody>
368
- <tr>
369
- <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>
370
- </tr>
371
- </tbody>
372
- </table>
373
- </div>
374
- </div>
375
- <p>&#160;</p>
376
- </div>
377
- <p>
378
- <br clear='all' class='section'/>
379
- </p>
380
- <div class='WordSection3'>
381
- <p class='zzSTDTitle1'/>
382
- <aside id='ftn1'>
383
- <p>X</p>
384
- </aside>
385
- </div>
386
- </body>
387
- </html>
375
+ <p>&#160;</p>
376
+ </div>
377
+ <p>
378
+ <br clear='all' class='section'/>
379
+ </p>
380
+ <div class='WordSection3'>
381
+ <p class='zzSTDTitle1'/>
382
+ <aside id='ftn1'>
383
+ <p>X</p>
384
+ </aside>
385
+ </div>
386
+ </body>
387
+ </html>
388
388
  OUTPUT
389
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
390
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
391
- expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", presxml, true).gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref"))).to be_equivalent_to xmlpp(word)
389
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
390
+ .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
391
+ expect(xmlpp(IsoDoc::HtmlConvert.new({})
392
+ .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
393
+ expect(xmlpp(IsoDoc::WordConvert.new({})
394
+ .convert("test", presxml, true)
395
+ .gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref")))
396
+ .to be_equivalent_to xmlpp(word)
392
397
  end
393
398
 
394
399
  it "processes big tables" do
395
- expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~INPUT, true).gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref"))).to be_equivalent_to xmlpp(<<~OUTPUT)
396
- <iso-standard xmlns="http://riboseinc.com/isoxml">
397
- <preface>
398
- <foreword>
399
- <table id="tableD-1" alt="tool tip" summary="long desc" width="70%" keep-with-next="true" keep-lines-together="true">
400
- <name>Repeatability and reproducibility of <em>husked</em> rice yield<fn reference="1"><p>X</p></fn></name>
401
- <thead>
402
- <tr>
403
- <td>
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
- Description Description Description Description Description Description Description Description Description
417
- Description Description Description Description Description Description Description Description Description
418
- Description Description Description Description Description Description Description Description Description
419
- Description Description Description Description Description Description Description Description Description
420
- Description Description Description Description Description Description Description Description Description
421
- Description Description Description Description Description Description Description Description Description
422
- Description Description Description Description Description Description Description Description Description
423
- Description Description Description Description Description Description Description Description Description
424
- Description Description Description Description Description Description Description Description Description
425
- Description Description Description Description Description Description Description Description Description
426
- Description Description Description Description Description Description Description Description Description
427
- Description Description Description Description Description Description Description Description Description
428
- Description Description Description Description Description Description Description Description Description
429
- Description Description Description Description Description Description Description Description Description
430
- Description Description Description Description Description Description Description Description Description
431
- Description Description Description Description Description Description Description Description Description
432
- Description Description Description Description Description Description Description Description Description
433
- Description Description Description Description Description Description Description Description Description
434
- Description Description Description Description Description Description Description Description Description
435
- Description Description Description Description Description Description Description Description Description
436
- Description Description Description Description Description Description Description Description Description
437
- Description Description Description Description Description Description Description Description Description
438
- Description Description Description Description Description Description Description Description Description
439
- Description Description Description Description Description Description Description Description Description
440
- Description Description Description Description Description Description Description Description Description
441
- Description Description Description Description Description Description Description Description Description
442
- Description Description Description Description Description Description Description Description Description
443
- Description Description Description Description Description Description Description Description Description
444
- </td>
445
- <td>Rice sample</td>
446
- </tr>
447
- </thead>
448
- </table>
449
- </foreword>
450
- </preface>
451
- </iso-standard>
400
+ input = <<~INPUT
401
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
402
+ <preface>
403
+ <foreword>
404
+ <table id="tableD-1" alt="tool tip" summary="long desc" width="70%" keep-with-next="true" keep-lines-together="true">
405
+ <name>Repeatability and reproducibility of <em>husked</em> rice yield<fn reference="1"><p>X</p></fn></name>
406
+ <thead>
407
+ <tr>
408
+ <td>
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
+ Description Description Description Description Description Description Description Description Description#{' '}
417
+ Description Description Description Description Description Description Description Description Description#{' '}
418
+ Description Description Description Description Description Description Description Description Description#{' '}
419
+ Description Description Description Description Description Description Description Description Description#{' '}
420
+ Description Description Description Description Description Description Description Description Description#{' '}
421
+ Description Description Description Description Description Description Description Description Description#{' '}
422
+ Description Description Description Description Description Description Description Description Description#{' '}
423
+ Description Description Description Description Description Description Description Description Description#{' '}
424
+ Description Description Description Description Description Description Description Description Description#{' '}
425
+ Description Description Description Description Description Description Description Description Description#{' '}
426
+ Description Description Description Description Description Description Description Description Description#{' '}
427
+ Description Description Description Description Description Description Description Description Description#{' '}
428
+ Description Description Description Description Description Description Description Description Description#{' '}
429
+ Description Description Description Description Description Description Description Description Description#{' '}
430
+ Description Description Description Description Description Description Description Description Description#{' '}
431
+ Description Description Description Description Description Description Description Description Description#{' '}
432
+ Description Description Description Description Description Description Description Description Description#{' '}
433
+ Description Description Description Description Description Description Description Description Description#{' '}
434
+ Description Description Description Description Description Description Description Description Description#{' '}
435
+ Description Description Description Description Description Description Description Description Description#{' '}
436
+ Description Description Description Description Description Description Description Description Description#{' '}
437
+ Description Description Description Description Description Description Description Description Description#{' '}
438
+ Description Description Description Description Description Description Description Description Description#{' '}
439
+ Description Description Description Description Description Description Description Description Description#{' '}
440
+ Description Description Description Description Description Description Description Description Description#{' '}
441
+ Description Description Description Description Description Description Description Description Description#{' '}
442
+ Description Description Description Description Description Description Description Description Description#{' '}
443
+ Description Description Description Description Description Description Description Description Description#{' '}
444
+ Description Description Description Description Description Description Description Description Description#{' '}
445
+ Description Description Description Description Description Description Description Description Description#{' '}
446
+ Description Description Description Description Description Description Description Description Description#{' '}
447
+ Description Description Description Description Description Description Description Description Description#{' '}
448
+ Description Description Description Description Description Description Description Description Description#{' '}
449
+ </td>
450
+ <td>Rice sample</td>
451
+ </tr>
452
+ </thead>
453
+ </table>
454
+ </foreword>
455
+ </preface>
456
+ </iso-standard>
452
457
  INPUT
453
- <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
454
- <head>
455
- <style>
456
- </style>
457
- </head>
458
- <body lang='EN-US' link='blue' vlink='#954F72'>
459
- <div class='WordSection1'>
460
- <p>&#160;</p>
461
- </div>
462
- <p>
463
- <br clear='all' class='section'/>
464
- </p>
465
- <div class='WordSection2'>
458
+
459
+ output = <<~OUTPUT
460
+ <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
461
+ <head>
462
+ <style>
463
+ </style>
464
+ </head>
465
+ <body lang='EN-US' link='blue' vlink='#954F72'>
466
+ <div class='WordSection1'>
467
+ <p>&#160;</p>
468
+ </div>
466
469
  <p>
467
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
470
+ <br clear='all' class='section'/>
468
471
  </p>
469
- <div>
470
- <h1 class='ForewordTitle'>Foreword</h1>
471
- <p class='TableTitle' style='text-align:center;'>
472
- Repeatability and reproducibility of
473
- <i>husked</i>
474
- rice yield
475
- <span style='mso-bookmark:_Ref'>
476
- <a class='FootnoteRef' href='#ftn1' epub:type='footnote'>
477
- <sup>1</sup>
478
- </a>
479
- </span>
472
+ <div class='WordSection2'>
473
+ <p>
474
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
480
475
  </p>
481
- <div align='center' class='table_container'>
482
- <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%'>
483
- <thead>
484
- <tr>
485
- <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;'>
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
- Description Description Description Description Description
531
- Description Description Description Description Description
532
- Description Description Description Description Description
533
- Description Description Description Description Description
534
- Description Description Description Description Description
535
- Description Description Description Description Description
536
- Description Description Description Description Description
537
- Description Description Description Description Description
538
- Description Description Description Description Description
539
- Description Description Description Description Description
540
- Description Description Description Description Description
541
- Description Description Description Description Description
542
- Description Description Description Description Description
543
- Description Description Description Description Description
544
- Description Description Description Description Description
545
- Description Description Description Description Description
546
- Description Description Description Description Description
547
- Description Description Description Description Description
548
- Description Description Description Description Description
549
- Description Description Description Description Description
550
- Description Description Description Description Description
551
- Description Description Description Description Description
552
- Description Description Description Description Description
553
- Description Description Description Description Description
554
- Description Description Description Description Description
555
- Description Description Description Description Description
556
- Description Description Description Description Description
557
- Description Description Description Description Description
558
- </td>
559
- <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>
560
- </tr>
561
- </thead>
562
- </table>
476
+ <div>
477
+ <h1 class='ForewordTitle'>Foreword</h1>
478
+ <p class='TableTitle' style='text-align:center;'>
479
+ Repeatability and reproducibility of
480
+ <i>husked</i>
481
+ rice yield
482
+ <span style='mso-bookmark:_Ref'>
483
+ <a class='FootnoteRef' href='#ftn1' epub:type='footnote'>
484
+ <sup>1</sup>
485
+ </a>
486
+ </span>
487
+ </p>
488
+ <div align='center' class='table_container'>
489
+ <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%'>
490
+ <thead>
491
+ <tr>
492
+ <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;'>
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
+ Description Description Description Description Description
531
+ Description Description Description Description Description
532
+ Description Description Description Description Description
533
+ Description Description Description Description Description
534
+ Description Description Description Description Description
535
+ Description Description Description Description Description
536
+ Description Description Description Description Description
537
+ Description Description Description Description Description
538
+ Description Description Description Description Description
539
+ Description Description Description Description Description
540
+ Description Description Description Description Description
541
+ Description Description Description Description Description
542
+ Description Description Description Description Description
543
+ Description Description Description Description Description
544
+ Description Description Description Description Description
545
+ Description Description Description Description Description
546
+ Description Description Description Description Description
547
+ Description Description Description Description Description
548
+ Description Description Description Description Description
549
+ Description Description Description Description Description
550
+ Description Description Description Description Description
551
+ Description Description Description Description Description
552
+ Description Description Description Description Description
553
+ Description Description Description Description Description
554
+ Description Description Description Description Description
555
+ Description Description Description Description Description
556
+ Description Description Description Description Description
557
+ Description Description Description Description Description
558
+ Description Description Description Description Description
559
+ Description Description Description Description Description
560
+ Description Description Description Description Description
561
+ Description Description Description Description Description
562
+ Description Description Description Description Description
563
+ Description Description Description Description Description
564
+ Description Description Description Description Description
565
+ </td>
566
+ <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>
567
+ </tr>
568
+ </thead>
569
+ </table>
570
+ </div>
563
571
  </div>
572
+ <p>&#160;</p>
573
+ </div>
574
+ <p>
575
+ <br clear='all' class='section'/>
576
+ </p>
577
+ <div class='WordSection3'>
578
+ <p class='zzSTDTitle1'/>
579
+ <aside id='ftn1'>
580
+ <p>X</p>
581
+ </aside>
564
582
  </div>
565
- <p>&#160;</p>
566
- </div>
567
- <p>
568
- <br clear='all' class='section'/>
569
- </p>
570
- <div class='WordSection3'>
571
- <p class='zzSTDTitle1'/>
572
- <aside id='ftn1'>
573
- <p>X</p>
574
- </aside>
575
- </div>
576
- </body>
577
- </html>
583
+ </body>
584
+ </html>
578
585
  OUTPUT
579
- end
580
-
586
+ expect(xmlpp(IsoDoc::WordConvert.new({})
587
+ .convert("test", input, true)
588
+ .gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref")))
589
+ .to be_equivalent_to xmlpp(output)
590
+ end
581
591
  end