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

[Bug]: <col> Tags Are Not Self-Closed, Causing Backend HTML Parsers to Fail #6226

Open
1 task done
LukasGrubis opened this issue Apr 1, 2025 · 2 comments
Open
1 task done
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@LukasGrubis
Copy link

Affected Packages

@tiptap/extension-table

Version(s)

2.11.5

Bug Description

We’ve encountered an issue where the generated <col> elements inside tables are rendered as:

<col style="min-width: 25px">

This is not valid HTML5. The <col> tag is a [void element](https://developer.mozilla.org/en-US/docs/Glossary/Void_element) and must be self-closing. It should be:

<col style="min-width: 25px" />

Problem

Our backend HTML parsers expect proper void tag declarations. The current form <col style="..."> is treated as invalid because it lacks a closing slash and is not self-closing, resulting in HTML parsing issues or broken rendering.

Example of Invalid Output

<colgroup>
  <col style="min-width: 25px">
  <col style="min-width: 25px">
  <col style="min-width: 25px">
</colgroup>

Expected Output

<colgroup>
  <col style="min-width: 25px" />
  <col style="min-width: 25px" />
  <col style="min-width: 25px" />
</colgroup>

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

Expected Output

<colgroup>
  <col style="min-width: 25px" />
  <col style="min-width: 25px" />
  <col style="min-width: 25px" />
</colgroup>

Additional Context (Optional)

We are using https://github.com/yikoyu/vuetify-pro-tiptap/tree/master

Dependency Updates

  • Yes, I've updated all my dependencies.
@LukasGrubis LukasGrubis added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Apr 1, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Tiptap: Issues Apr 1, 2025
@ianGhostdog
Copy link

While I prefer including the trailing / on void elements, I've always understood HTML5 as not requiring them: https://html.spec.whatwg.org/multipage/syntax.html#start-tags

@haggys22
Copy link

haggys22 commented Apr 2, 2025

Quoting the MDN documentation for void elements you linked:

Self-closing tags (<tag />) do not exist in HTML.

To me it sounds like you are trying to parse valid HTML5 with an XML or XHTML parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Needs Triage
Development

No branches or pull requests

3 participants