spec/isodoc/table_spec.rb in isodoc-1.2.3 vs spec/isodoc/table_spec.rb in isodoc-1.2.4
- old
+ new
@@ -1,10 +1,10 @@
require "spec_helper"
RSpec.describe IsoDoc do
- it "processes IsoXML tables (Presentation XML)" do
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
+ it "processes IsoXML tables" do
+ input = <<~INPUT
<iso-standard xmlns="http://riboseinc.com/isoxml">
<preface>
<foreword>
<table id="tableD-1" alt="tool tip" summary="long desc" width="70%" keep-with-next="true" keep-lines-together="true">
<name>Repeatability and reproducibility of <em>husked</em> rice yield<fn reference="1"><p>X</p></fn></name>
@@ -12,15 +12,15 @@
<tr>
<td rowspan="2" align="left">Description</td>
<td colspan="4" align="center">Rice sample</td>
</tr>
<tr>
- <td align="left">Arborio</td>
- <td align="center">Drago<fn reference="a">
+ <td valign="top" align="left">Arborio</td>
+ <td valign="middle" align="center">Drago<fn reference="a">
<p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
</fn></td>
- <td align="center">Balilla<fn reference="a">
+ <td valign="bottom" align="center">Balilla<fn reference="a">
<p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
</fn></td>
<td align="center">Thaibonnet</td>
</tr>
</thead>
@@ -51,21 +51,22 @@
</tfoot>
<dl>
<dt>Drago</dt>
<dd>A type of rice</dd>
</dl>
-<note><name>NOTE</name><p>This is a table about rice</p></note>
+<note><p>This is a table about rice</p></note>
</table>
<table id="tableD-2" unnumbered="true">
<tbody><tr><td>A</td></tr></tbody>
</table>
</foreword>
</preface>
</iso-standard>
INPUT
- <?xml version='1.0'?>
+
+ presxml = <<~OUTPUT
<iso-standard xmlns='http://riboseinc.com/isoxml'>
<preface>
<foreword>
<table id='tableD-1' alt='tool tip' summary='long desc' width='70%' keep-with-next='true' keep-lines-together='true'>
<name>
@@ -80,18 +81,18 @@
<tr>
<td rowspan='2' align='left'>Description</td>
<td colspan='4' align='center'>Rice sample</td>
</tr>
<tr>
- <td align='left'>Arborio</td>
- <td align='center'>
+ <td valign="top" align='left'>Arborio</td>
+ <td valign="middle" align='center'>
Drago
<fn reference='a'>
<p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
</fn>
</td>
- <td align='center'>
+ <td valign="bottom" align='center'>
Balilla
<fn reference='a'>
<p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
</fn>
</td>
@@ -132,11 +133,11 @@
<dl>
<dt>Drago</dt>
<dd>A type of rice</dd>
</dl>
<note>
- <name>NOTENOTE</name>
+ <name>NOTE</name>
<p>This is a table about rice</p>
</note>
</table>
<table id='tableD-2' unnumbered='true'>
<tbody>
@@ -147,74 +148,12 @@
</table>
</foreword>
</preface>
</iso-standard>
OUTPUT
- end
- it "processes IsoXML tables" do
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
- <iso-standard xmlns="http://riboseinc.com/isoxml">
- <preface>
- <foreword>
- <table id="tableD-1" alt="tool tip" summary="long desc" width="70%" keep-with-next="true" keep-lines-together="true">
- <name>Table 1 — Repeatability and reproducibility of <em>husked</em> rice yield<fn reference="1"><p>X</p></fn></name>
- <thead>
- <tr>
- <td rowspan="2" align="left">Description</td>
- <td colspan="4" align="center">Rice sample</td>
- </tr>
- <tr>
- <td align="left">Arborio</td>
- <td align="center">Drago<fn reference="a">
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
-</fn></td>
- <td align="center">Balilla<fn reference="a">
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
-</fn></td>
- <td align="center">Thaibonnet</td>
- </tr>
- </thead>
- <tbody>
- <tr>
- <th align="left">Number of laboratories retained after eliminating outliers</th>
- <td align="center">13</td>
- <td align="center">11</td>
- <td align="center">13</td>
- <td align="center">13</td>
- </tr>
- <tr>
- <td align="left">Mean value, g/100 g</td>
- <td align="center">81,2</td>
- <td align="center">82,0</td>
- <td align="center">81,8</td>
- <td align="center">77,7</td>
- </tr>
- </tbody>
- <tfoot>
- <tr>
- <td align="left">Reproducibility limit, <stem type="AsciiMath">R</stem> (= 2,83 <stem type="AsciiMath">s_R</stem>)</td>
- <td align="center">2,89</td>
- <td align="center">0,57</td>
- <td align="center">2,26</td>
- <td align="center">6,06</td>
- </tr>
- </tfoot>
- <dl>
- <dt>Drago</dt>
-<dd>A type of rice</dd>
-</dl>
-<note><name>NOTE</name><p>This is a table about rice</p></note>
-</table>
-
-<table id="tableD-2" unnumbered="true">
-<tbody><tr><td>A</td></tr></tbody>
-</table>
-</foreword>
-</preface>
-</iso-standard>
- INPUT
+html = <<~OUTPUT
#{HTML_HDR}
<br/>
<div>
<h1 class="ForewordTitle">Foreword</h1>
<p class="TableTitle" style="text-align:center;">Table 1 — Repeatability and reproducibility of <i>husked</i> rice yield
@@ -230,15 +169,15 @@
<tr>
<td rowspan="2" style="text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;" scope="col">Description</td>
<td colspan="4" style="text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;" scope="colgroup">Rice sample</td>
</tr>
<tr>
- <td style="text-align:left;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Arborio</td>
- <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>  </span>
+ <td style="text-align:left;vertical-align:top;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Arborio</td>
+ <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>  </span>
<p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
</div></aside></td>
- <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>
+ <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>
<td style="text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;" scope="col">Thaibonnet</td>
</tr>
</thead>
<tbody>
<tr>
@@ -289,166 +228,326 @@
</aside>
</div>
</body>
</html>
OUTPUT
- end
- it "processes IsoXML tables (Word)" do
- expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true).gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
- <iso-standard xmlns="http://riboseinc.com/isoxml">
- <preface>
- <foreword>
- <table id="tableD-0">
- <name>Table 1</name>
- <tbody><tr><td>A</td></tr></tbody>
- </table>
- <table id="tableD-1" alt="tool tip" summary="long desc" width="70%">
- <name>Table 2 — Repeatability and reproducibility of husked rice yield<fn reference="1"><p>X</p></fn></name>
- <thead>
- <tr>
- <td rowspan="2" align="left">Description</td>
- <td colspan="4" align="center">Rice sample</td>
- </tr>
- <tr>
- <td align="left">Arborio</td>
- <td align="center">Drago<fn reference="a">
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
-</fn></td>
- <td align="center">Balilla<fn reference="a">
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
-</fn></td>
- <td align="center">Thaibonnet</td>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td align="left">Number of laboratories retained after eliminating outliers</td>
- <td align="center">13</td>
- <td align="center">11</td>
- <td align="center">13</td>
- <td align="center">13</td>
- </tr>
- <tr>
- <td align="left">Mean value, g/100 g</td>
- <td align="center">81,2</td>
- <td align="center">82,0</td>
- <td align="center">81,8</td>
- <td align="center">77,7</td>
- </tr>
- </tbody>
- <tfoot>
- <tr>
- <td align="left">Reproducibility limit, <stem type="AsciiMath">R</stem> (= 2,83 <stem type="AsciiMath">s_R</stem>)</td>
- <td align="center">2,89</td>
- <td align="center">0,57</td>
- <td align="center">2,26</td>
- <td align="center">6,06</td>
- </tr>
- </tfoot>
- <dl>
- <dt>Drago</dt>
-<dd>A type of rice</dd>
-</dl>
-<note><name>NOTE</name><p>This is a table about rice</p></note>
-</table>
-</foreword>
-</preface>
-</iso-standard>
- INPUT
+ word = <<~OUTPUT
<html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
<head><style/></head>
- <body lang="EN-US" link="blue" vlink="#954F72">
- <div class="WordSection1">
- <p> </p>
- </div>
- <p><br clear="all" class="section"/></p>
- <div class="WordSection2">
- <p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
- <div>
- <h1 class="ForewordTitle">Foreword</h1>
- <p class="TableTitle" style="text-align:center;">Table 1</p>
- <div align="center" class="table_container">
- <table id="tableD-0" class="MsoISOTable" style="mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;">
- <tbody>
- <tr>
- <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>
- </tr>
- </tbody>
- </table>
- </div>
- <p class="TableTitle" style="text-align:center;">Table 2 — Repeatability and reproducibility of husked rice yield
+ <body lang='EN-US' link='blue' vlink='#954F72'>
+ <div class='WordSection1'>
+ <p> </p>
+ </div>
+ <p>
+ <br clear='all' class='section'/>
+ </p>
+ <div class='WordSection2'>
+ <p>
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
+ </p>
+ <div>
+ <h1 class='ForewordTitle'>Foreword</h1>
+ <p class='TableTitle' style='text-align:center;'>
+ Table 1 — Repeatability and reproducibility of
+ <i>husked</i>
+ rice yield
<span style='mso-bookmark:_Ref'>
- <a href='#ftn1' epub:type='footnote' class='FootnoteRef'>
- <sup>1</sup>
- </a>
- </span>
- </p>
- <div align="center" class="table_container">
- <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%">
+ <a class='FootnoteRef' href='#ftn1' epub:type='footnote'>
+ <sup>1</sup>
+ </a>
+ </span>
+ </p>
+ <div align='center' class='table_container'>
+ <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%'>
<thead>
<tr>
- <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>
- <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>
+ <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>
+ <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>
</tr>
<tr>
- <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>
- <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">  </span></span>
- <p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p>
- </div></aside></td>
- <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>
- <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>
+ <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>
+ <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;'>
+ 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'>  </span>
+ </span>
+ <p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
+ </div>
+ </aside>
+ </td>
+ <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;'>
+ Balilla
+ <a href='#tableD-1a' class='TableFootnoteRef'>a</a>
+ </td>
+ <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>
</tr>
</thead>
<tbody>
<tr>
- <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>
- <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>
- <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>
- <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>
- <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>
+ <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>
+ <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>
+ <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>
+ <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>
+ <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>
</tr>
<tr>
- <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>
- <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>
- <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>
- <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>
- <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>
+ <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>
+ <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>
+ <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>
+ <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>
+ <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>
</tr>
</tbody>
<tfoot>
<tr>
- <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>
- <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>
- <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>
- <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>
- <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>
+ <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>
+ <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>
+ <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>
+ <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>
+ <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>
</tr>
</tfoot>
- <table class="dl">
+ <table class='dl'>
<tr>
- <td valign="top" align="left">
- <p align="left" style="margin-left:0pt;text-align:left;">Drago</p>
+ <td valign='top' align='left'>
+ <p align='left' style='margin-left:0pt;text-align:left;'>Drago</p>
</td>
- <td valign="top">A type of rice</td>
+ <td valign='top'>A type of rice</td>
</tr>
</table>
- <div class="Note">
- <p class="Note"><span class="note_label">NOTE</span><span style="mso-tab-count:1">  </span>This is a table about rice</p>
+ <div class='Note'>
+ <p class='Note'>
+ <span class='note_label'>NOTE</span>
+ <span style='mso-tab-count:1'>  </span>
+ This is a table about rice
+ </p>
</div>
</table>
- </div>
</div>
- <p> </p>
+ <div align='center' class='table_container'>
+ <table id='tableD-2' class='MsoISOTable' style='mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;'>
+ <tbody>
+ <tr>
+ <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>
+ </tr>
+ </tbody>
+ </table>
+ </div>
</div>
- <p><br clear="all" class="section"/></p>
- <div class="WordSection3">
- <p class="zzSTDTitle1"/>
- <aside id='ftn1'>
- <p>X</p>
-</aside>
- </div>
- </body>
+ <p> </p>
+ </div>
+ <p>
+ <br clear='all' class='section'/>
+ </p>
+ <div class='WordSection3'>
+ <p class='zzSTDTitle1'/>
+ <aside id='ftn1'>
+ <p>X</p>
+ </aside>
+ </div>
+ </body>
</html>
OUTPUT
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
+ expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", presxml, true).gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref"))).to be_equivalent_to xmlpp(word)
end
+
+ it "processes big tables" do
+ expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~INPUT, true).gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref"))).to be_equivalent_to xmlpp(<<~OUTPUT)
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
+ <preface>
+ <foreword>
+ <table id="tableD-1" alt="tool tip" summary="long desc" width="70%" keep-with-next="true" keep-lines-together="true">
+ <name>Repeatability and reproducibility of <em>husked</em> rice yield<fn reference="1"><p>X</p></fn></name>
+ <thead>
+ <tr>
+ <td>
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+Description Description Description Description Description Description Description Description Description
+ </td>
+ <td>Rice sample</td>
+ </tr>
+ </thead>
+ </table>
+ </foreword>
+ </preface>
+ </iso-standard>
+ INPUT
+ <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
+ <head>
+ <style>
+ </style>
+ </head>
+ <body lang='EN-US' link='blue' vlink='#954F72'>
+ <div class='WordSection1'>
+ <p> </p>
+ </div>
+ <p>
+ <br clear='all' class='section'/>
+ </p>
+ <div class='WordSection2'>
+ <p>
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
+ </p>
+ <div>
+ <h1 class='ForewordTitle'>Foreword</h1>
+ <p class='TableTitle' style='text-align:center;'>
+ Repeatability and reproducibility of
+ <i>husked</i>
+ rice yield
+ <span style='mso-bookmark:_Ref'>
+ <a class='FootnoteRef' href='#ftn1' epub:type='footnote'>
+ <sup>1</sup>
+ </a>
+ </span>
+ </p>
+ <div align='center' class='table_container'>
+ <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%'>
+ <thead>
+ <tr>
+ <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;'>
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ Description Description Description Description Description
+ </td>
+ <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>
+ </tr>
+ </thead>
+ </table>
+ </div>
+ </div>
+ <p> </p>
+ </div>
+ <p>
+ <br clear='all' class='section'/>
+ </p>
+ <div class='WordSection3'>
+ <p class='zzSTDTitle1'/>
+ <aside id='ftn1'>
+ <p>X</p>
+ </aside>
+ </div>
+ </body>
+ </html>
+ OUTPUT
+end
+
end