StackExchange / StackExchange/Stacks-Editor
bug(commonmark) Header html tags in table cells do not round-trip or preview properly
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 437
- Forks
- 61
- Avg merge
- 16h 2m
- Merged PRs (30d)
- 8
Description
Describe the bug
Header html tags used in table header or body cells end up not previewing properly in RT mode and mangle the table upon round-trip. It works in current editor when saved to the site - renders properly.
To Reproduce
- MD mode, create table, add an
h1html tag in any cell around the text - Go to RT mode, observe that the tag has been transformed as a literal
- Go back to MD mode and the table syntax is all messed up and mangled
Expected behavior
Ideally we would support header elements in table cells. The GH MD table spec does not mention it, but the current editor and on-side rendering support it. If we decide not to support it, should at least allow round-trip without destroying the table markdup.
Screenshots

Desktop (please complete the following information):
Windows 11 Chrome 103
Additional context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue in the Stacks-Editor MD and RT modes with a table cell containing an h1 HTML tag, then inspect the commonmark conversion path. Done means the header renders correctly in RT mode and returning to MD mode preserves the table syntax, or preserves it without mangling if header elements remain unsupported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100