Skip to content

fix(ui): table cells with spans now work correctly

Dan Visel requested to merge jats-tablecell-fixes into main

This is to address an issue identified in the comments of #706 (closed) (which isn't quite the same as the main issue, which is resolved).

The code I added to fix tables in JATS sends all of the content of every <td> through the HTML to JATS function so that headers are treated correctly. So if we start with these cells:

<td>Hi</td>
<td><p class="paragraph">Hi</p></td>
<td><p class="paragraph"><strong>Hi</strong></p></td>

they come out looking like this:

<td>Hi</td>
<td><p>Hi</p></td>
<td><p><bold>Hi</bold></p></td>

But the tables are still part of the string of HTML coming out of Wax, and that string gets fed back into the HTML to JATS function again. What was happening was that that <strong> tag that is proper JATS was unidentified by the HTML to JATS parser and was being thrown away, so what we got was this:

<td>Hi</td>
<td><p>Hi</p></td>
<td><p>Hi</p></td>

My fix for this was to add the JATS equivalents of the span tags to tagsToIgnore; so JATS that is already in the HTML is ignored.

Merge request reports