FEATURE: Allow rowspan and colspan attributes on HTML tables (#20973)

Augment the `allowList` for HTML tables to allow the `rowspan` and
`colspan` attributes on `th` and `td` elements.
This commit is contained in:
John L. Clark 2024-02-28 00:59:36 -05:00 committed by GitHub
parent 5bf06f2634
commit 9a07a9872f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -34,7 +34,11 @@ export function setup(helper) {
"thead",
"tr",
"th",
"th[colspan]",
"th[rowspan]",
"td",
"td[colspan]",
"td[rowspan]",
"div.md-table",
]);
}

View File

@ -157,6 +157,11 @@ module("Unit | Utility | sanitizer", function (hooks) {
`<div data-value="<something>" data-html-value="<something>"></div>`,
`<div data-value="&lt;something&gt;"></div>`
);
cooked(
'<table><tr><th rowspan="2">a</th><th colspan="3">b</th><td rowspan="4">c</td><td colspan="5">d</td><td class="fa-spin">e</td></tr></table>',
'<table><tr><th rowspan="2">a</th><th colspan="3">b</th><td rowspan="4">c</td><td colspan="5">d</td><td>e</td></tr></table>'
);
});
test("ids on headings", function (assert) {