-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better detection of heading rows #3172
Comments
This will be important for pasting. And for handling some legacy data (although, of course, CKEditor 4 does produce |
Another case - non-semantic heading section in <table>
<caption>Concerts</caption>
<tbody>
<tr>
<th>Date</th>
<th>Event</th>
<th>Venue</th>
</tr>
<tr>
<td>12 Feb</td>
<td>Waltz with Strauss</td>
<td>Main Hall</td>
</tr>
<tr>
<td>24 Mar</td>
<td>The Obelisks</td>
<td>West Wing</td>
</tr>
<tr>
<td>14 Apr</td>
<td>The What</td>
<td>Main Hall</td>
</tr>
</tbody>
</table> Edit: reported also in ckeditor/ckeditor5-table#109. |
@Reinmar We might consider a simple fix for this. A case when there is a row with only It keeps coming back from time to time: ckeditor/ckeditor5-table#109, ckeditor/ckeditor5-table#140. |
👍 In general, I think we need two separate mechanisms:
If you agree that this algorithm makes sense, then we could try to go this way. I don't mean that we have to rewrite what we have right now, but we should keep it in mind when making decisions about fixing some issues. |
This is how this works now: We only lacks the mechanism of not counting columns in heading row. |
Also got it reported from one of our users today. |
Notes:
For this input: <table>
<tr>
<th>a</th>
<th>b</th>
</tr>
<tr>
<th>c</th>
<td>d</td>
</tr>
</table> This is the expected output: <figure class=table>
<table>
<thead>
<tr>
<th>a</th>
<th>b</th>
</tr>
</thead>
<tbody>
<tr>
<th>c</th>
<td>d</td>
</tr>
</tbody>
</table>
</figure> |
…able-heading-rows-and-columns Fix (table): Change detection on heading rows and columns on table upcast. Closes #3172.
Right now when upcasting table row it is assumed that
headingRows
attribute is calculated only from number of rows of first<thead>
section (following<thead>
sections are treated as normal rows).The other case might be when a
<table>
element does not have<thead>
nor<tbody>
sections or a<tbody>
section with "pseudo table head".The "pseudo table head" is a row which contains only
<th>
elements.We might detect such rows as heading rows because right now they will be counted as heading columns which will result in wrong table:
For instance such table:
will be converted to a model representation:
but should be:
The text was updated successfully, but these errors were encountered: