html to jats chokes on tables with headers in them
Here's some HTML of a table that was imported into Kotahi:
<p class="paragraph">This is a multiplication table</p>
<table><tbody>
<tr><td><p class="paragraph"></p></td><td><h2>Column 1</h2></td><td><h2>Column ff2</h2></td><td><h2>Column 3</h2></td></tr>
<tr><td><h2>Row 1</h2></td><td><h2>1</h2></td><td><h2>2</h2></td><td><h2>3</h2></td></tr>
<tr><td><h2>Row 2</h2></td><td><h2>2</h2></td><td><h2>4</h2></td><td><h2>6</h2></td></tr>
<tr><td><h2>Row 3</h2></td><td><h2>3</h2></td><td><h2>6</h2></td><td><h2>9</h2></td></tr>
<tr><td><h2>Row 4</h2></td><td><h2>4</h2></td><td><h2>8 </h2></td><td><h2>12</h2></td></tr>
</tbody></table>
<p class="paragraph">That should look like a multiplication table.</p>
What's important here: inside the <td>
tags are <h2>
s which Wax allows you to do. I modded the HTML to JATs function to pass table tags through; however, it seems to crash when it gets a header element that's alone by itself. Here's what comes out:
<body>
<p>This is a multiplication table </p>
<table><tbody>
<tr><td><p></p></td><td><sec><title>Column 1</title></td><td></sec><sec><title>Column ff2</title></td><td></sec><sec><title>Column 3</title></td></tr>
<tr><td></sec><sec><title>Row 1</title></td><td></sec><sec><title>1</title></td><td></sec><sec><title>2</title></td><td></sec><sec><title>3</title></td></tr>
<tr><td></sec><sec><title>Row 2</title></td><td></sec><sec><title>2</title></td><td></sec><sec><title>4</title></td><td></sec><sec><title>6</title></td></tr>
<tr><td></sec><sec><title>Row 3</title></td><td></sec><sec><title>3</title></td><td></sec><sec><title>6</title></td><td></sec><sec><title>9</title></td></tr>
<tr><td></sec><sec><title>Row 4</title></td><td></sec><sec><title>4</title></td><td></sec><sec><title>8 </title></td><td></sec><sec><title>12</title></td></tr>
</tbody></table>
<p>That should look like a multiplication table.</p>
</sec>
</body>
This makes the XML parsing fail. I think what should happen is that anything inside a <td>
should be treated as the limits for a section?