-
-
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
Provide a solution for how to downcast a table to table>caption #10892
Comments
This ticket might also require to look at this one: #9360 Although strictly speaking it's not a blocker to complete the current one, but it makes it obvious that there is something wrong with the simplest of payloads. For example: <table>
<caption>Monthly savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table> Will be upcasted to: <table headingColumns="2">...</table> Which later will be downcasted in the data pipeline to: <table>
<caption>Monthly savings</caption>
<tbody>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<th>January</th>
<th>$100</th>
</tr>
</tbody>
</table> Couple notes:
Also worth to mention that loading the following markup will result in the same thing: <table>
<caption>Monthly savings</caption>
<tbody>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</tbody>
</table> This on the other hand will be good: <table>
<caption>Monthly savings</caption>
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</tbody>
</table> It's the exact same problem as described in #9360. The problem source is located in this part of the code: Basically what is happening is:
Since we have no In our case we have two |
Some plugin naming ideas:
|
I went with |
@dawidurbanski and I checked the behavior of GHS together with both regular and plain table support and we found no issues whatsoever. Both the allowed inline elements and their attributes were handled correctly, along with attributes on As such the compatibility issues with GHS should be considered solved. |
|
Yes. The default for us (and "native") is |
Feature (table): Introduced the `PlainTableOutput` plugin to override the default `figure>caption` markup in the data pipeline (it outputs the table as `table>caption`). Closes: #10892. Tests (table): Added tests for the `TableCaptionUI` plugin.
By default we use
<figure class=table>
with<figcaption>
which was a design choice made at the beginning mostly because:<figure>
<figure>
being more genericHowever, in some cases, e.g. in Drupal,
<table>
+<caption>
is the expected markup.I don't think we should have it as a configuration option, because the table feature exists for a long time and this was requested for the second time to my knowledge. But we can provide (even here) a code sample on how to change the output of the editor.
Other remarks:
<caption>
-> separate ticket ([GHS] Support <caption>'s additional attributes #10896)<figure>
. After this customization,<figure>
disappears, so the style needs to be moved to<table>
.The text was updated successfully, but these errors were encountered: