Skip to content

fix: preserve literal HTML in Markdown table exports - #618

Open
lllleolin-max wants to merge 1 commit into
vercel:mainfrom
lllleolin-max:lllleolin-max/fix-markdown-table-literals
Open

fix: preserve literal HTML in Markdown table exports#618
lllleolin-max wants to merge 1 commit into
vercel:mainfrom
lllleolin-max:lllleolin-max/fix-markdown-table-literals

Conversation

@lllleolin-max

Copy link
Copy Markdown

Description

Copying or downloading a table as Markdown can change its cell text when the export is rendered again. For example, Array<string> becomes Array, and the literal text &copy; becomes ©.

Escape &, <, and > in the shared Markdown cell serializer so those values survive export. The existing single-pass serializer still emits <br> for actual newlines.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Changes Made

  • Preserve literal HTML and character entities in Markdown table exports, including headers.
  • Add a DOM → Markdown → DOM regression test using the existing marked dependency.
  • Add a patch changeset for streamdown.

Testing

  • Added new tests for the changes
  • All existing tests in the changed package pass: pnpm --filter streamdown test — 85 files, 1,173 tests.
  • Confirmed the new regression fails on the original serializer and passes with the fix (47 table utility tests).
  • pnpm -r --filter 'streamdown...' build — core and dependency packages build, including declarations.
  • pnpm check — 291 files checked.
  • Manually tested the changes

An extra pnpm --filter streamdown exec tsc --noEmit check reports 211 existing diagnostics on both the original and patched source; diagnostics match after normalizing source positions. This check is not passing on the baseline either.

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective
  • New and existing unit tests in the changed package pass locally
  • I have created a changeset

Changeset

  • I have created a changeset for these changes

Additional Notes

Prepared with OpenAI Codex. Automated tests and Codex agent review were completed; no independent human review is claimed.

Escape HTML-sensitive characters in table cell text and verify DOM-to-Markdown round trips.

Assisted-by: OpenAI GPT-6 <noreply@openai.com>
@vercel

vercel Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

@lllleolin-max is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant