Skip to content
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

colgroup and col elements are removed from markup when configured as allowed in GHS #15368

Open
ericgsmith opened this issue Nov 17, 2023 · 7 comments · May be fixed by #15573
Open

colgroup and col elements are removed from markup when configured as allowed in GHS #15368

ericgsmith opened this issue Nov 17, 2023 · 7 comments · May be fixed by #15573
Labels
domain:dx This issue reports a developer experience problem or possible improvement. package:html-support type:bug This issue reports a buggy (incorrect) behavior.

Comments

@ericgsmith
Copy link

ericgsmith commented Nov 17, 2023

📝 Provide detailed reproduction steps (if any)

When specifying col and colgroup elements as allowed for General HTML support they are being removed if the Table plugin is enabled but the TableResize plugin is not.

See the MR #15573 - manual test "table-no-resize"

✔️ Expected result

Expected result is the the col and colgroup elements remain in the HTML.

❌ Actual result

View HTML does not contain the col and colgroup elements.

The model does contain the HTML - but this is not rendered when the table is.

In the inspector for the table-resize test I can see 2 schema definitions for col and colgroup:

htmlCol / htmlColgroup and the tableColumn / tableColumnGroup definitions:

image

The tableColumn / tableColumnGroup definitions are missing the allowedIn: table definition.

In the model the HTML is showing as htmlCol and htmlColgroup - but this is not allowed in the table schema - so nothing is rendered in the view.

image

❓ Possible solution

Unsure of the solution - seems like only 1 schema should exist and it should have all the information needed to be retained.


If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@ericgsmith ericgsmith added the type:bug This issue reports a buggy (incorrect) behavior. label Nov 17, 2023
@ericgsmith ericgsmith changed the title colgroup and col elements are removed from markup when listed as allowed in GHS colgroup and col elements are removed from markup when configured as allowed in GHS Nov 17, 2023
@Witoso
Copy link
Member

Witoso commented Nov 17, 2023

The GHS doesn't support empty elements right now:

// Skipped elements due to lack empty element support:
// * hr
// * area
// * br
// * command
// * map
// * wbr
// * colgroup -> col

@Witoso Witoso added package:html-support domain:dx This issue reports a developer experience problem or possible improvement. labels Nov 17, 2023
@wimleers
Copy link

@Witoso But <colgroup> isn't an empty element? <col> is indeed.

@wimleers
Copy link

@Witoso
Copy link
Member

Witoso commented Nov 17, 2023

I assume there's some relation there that blocked us, maybe @niegowski could share more here.

@ericgsmith
Copy link
Author

Hi there - sorry for the delay on this - it looks like support was added in #13328 but just the docs are out of date?

I should have been clearer in the description that GHS does work for col and colgroup elements when:

✅ - the TableResize plugin is enabled or
✅ - Table plugin is not enabled -

❌ it does not work in the scenario where Table is enabled but TableResize is not.

@ericgsmith
Copy link
Author

ericgsmith commented Dec 20, 2023

Ok - I have added #15573 to

  • extend table, ghs-all-features and ghs-no-features manual tests to show the elements are supported in certain circumstances
  • add manual test fortable-resize to show where its not working

Updated issue description with a better explanation - initial issue description wasn't clear as I had no idea what I was look at 🙈

I don't know if I can commit additional time to fix - but if somebody can suggest where this can be fixed I can certainly try where I can. Other step would be removing the comment that implies this element has no support

@Witoso
Copy link
Member

Witoso commented Dec 27, 2023

@filipsobol would be great if you could take a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:dx This issue reports a developer experience problem or possible improvement. package:html-support type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
3 participants