ueberdosis/tiptap

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

Open

#6,226 opened on Apr 1, 2025

View on GitHub
 (2 comments) (0 reactions) (0 assignees)TypeScript (1,979 forks)batch import
area: editorcomplexity: easygood first issueimpact: medium

Repository metrics

Stars
 (23,454 stars)
PR merge metrics
 (Avg merge 4d 13h) (46 merged PRs in 30d)

Description

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.

Contributor guide