Problem/Motivation
Entered this table in CKEditor 4
(from the database)
<div class="usa-table-container">
<table class="usa-table usa-table--striped usa-table--stacked">
<caption>test caption</caption>
<thead>
<tr>
<th scope="col">this</th>
<th scope="col">is </th>
<th scope="col">aAliquam aliquam nulla in ante aliquet porttitor</th>
<th scope="col">test</th>
<th scope="col">only</th>
</tr>
</thead>
<tbody>
<tr>
<td>this</td>
<td>is</td>
<td>Aliquam aliquam nulla in ante aliquet porttitor</td>
<td>a</td>
<td>test</td>
</tr>
<tr>
<td>if</td>
<td>thisAliquam aliquam nulla in ante aliquet porttitor</td>
<td>were</td>
<td>a</td>
<td>real</td>
</tr>
<tr>
<td>Aliquam aliquam nulla in ante aliquet porttitor</td>
<td>it</td>
<td>would</td>
<td>contain</td>
<td>actual</td>
</tr>
<tr>
<td>data</td>
<td>that</td>
<td>might</td>
<td>Aliquam aliquam nulla in ante aliquet porttitor</td>
<td>useful</td>
</tr>
</tbody>
</table>
</div>
after being run through the Filter(filter_table_attributes) I get
<table class="usa-table usa-table--striped usa-table--stacked"><caption>test caption</caption>
<thead><tr><th scope="row">header 1</th>
<th scope="row">header 2</th>
<th scope="row">header 4</th>
<th scope="row">header 4</th>
<th scope="row">header 5</th>
</tr></thead><tbody><tr><td data-label="header 1">cell 1,1</td>
<td data-label="header 1">cell 1,2</td>
<td data-label="header 1">cell 1,3</td>
<td data-label="header 1">cell 1,4</td>
<td data-label="header 1">cell 1,5</td>
</tr><tr><td data-label="header 1">cell 2,1</td>
<td data-label="header 1">cell 2,2</td>
<td data-label="header 1">cell 2,3</td>
<td data-label="header 1">cell 2,4</td>
<td data-label="header 1">cell 2,5</td>
</tr><tr><td data-label="header 1">cell 3,1</td>
<td data-label="header 1">cell 3,2</td>
<td data-label="header 1">cell 3,3</td>
<td data-label="header 1">cell 3,4</td>
<td data-label="header 1">cell 3,5</td>
</tr><tr><td data-label="header 1">cell 4,1</td>
<td data-label="header 1">cell 4,2</td>
<td data-label="header 1">cell 4,3</td>
<td data-label="header 1">cell 4,4</td>
<td data-label="header 1">cell 4,5</td>
</tr></tbody></table></div>
all rows with the same header
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
jrglasgow commentedIn looking at this I noticed a few things where the table row is getting processed...
in the foreach loop internal to the row the
$countervariable is never incremented.I also noticed that the xpath query
$tbodyTags = $xpath->query('//tbody//td|//th', $row);returns a list of 25 items... so it was looping through not only the items in the current row, but it was also looping through all of the cells in the table for each row.I modified this to instead just grab the
Comment #3
jrglasgow commentedhere is my patch
Comment #5
jrglasgow commentedfound a couple of small issues with my patch
Comment #8
smustgrave commentedConfirmed the issue and that your MR 62 fixed it thanks!