Skip to content

fix(export): render HTML tables and preserve vertical alignment - #752

Merged
murongg merged 1 commit into
v2from
fix/750-html-table-export
Oct 5, 2026
Merged

murongg merged 1 commit into
v2from
fix/750-html-table-export

Conversation

@murongg

@murongg murongg commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Raw HTML tables were escaped by the shared preview renderer, so HTML and PDF exports printed HTML source instead of a table. Render block HTML through the editor's existing sanitizer and preserve vertical-align so merged cells honor authored alignment in the editor, preview, and export.

Regression tests cover merged rows and columns, HTML blocks inside quotes and lists, image path resolution, unsafe HTML filtering, document updates, and editor recreation. Fenced HTML remains code. No new dependencies or changes to authored Markdown are required.

Closes #750

Validation

  • pnpm --filter @markra/editor test -- src/raw-html-sanitize.test.ts src/codemirror/html-table-widget.test.ts src/codemirror/raw-html-preview.test.ts — 58 tests passed.
  • pnpm --filter @markra/app test -- src/components/MarkdownExportDocument.test.tsx src/components/MarkdownPreviewDocument.test.tsx src/lib/document-export.test.ts — 24 tests passed.
  • pnpm --filter @markra/app typecheck:test and pnpm --filter @markra/editor typecheck:test — passed.
  • pnpm build — all workspace builds passed, including desktop and web bundles and the desktop vendor chunk check.
  • Headless Chrome QA with synthetic data: merged cells were vertically centered in the editor, preview, and exported document; click/blur preserved Markdown; no browser errors. Inspected screenshots and the rendered PDF page, and confirmed the PDF contains a real table rather than HTML source.

Windows native export was not run on this macOS host; the shared export renderer and Chromium PDF output were verified.

@vercel

vercel Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
markra-web Ready Ready Preview Oct 4, 2026 3:30pm UTC

@murongg
murongg merged commit 6f40262 into v2 Oct 5, 2026
23 checks passed
@murongg
murongg deleted the fix/750-html-table-export branch October 5, 2026 00:30

This branch was successfully deployed

1 active deployment
Preview — 682350ba Deployed Oct 4, 2026 by vercel[bot]
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.

[Bug]: HTML格式解析和导出

1 participant