Repository navigation
feat(export): add Markdown and HTML result export formats - #1567
Merged
Merged
Conversation
koraysrn
force-pushed
the
feat/1532-export-markdown-html
branch
from
October 6, 2026 19:59
c288718 to
c073e0f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…ats in FEATURES.md Each line break in a Markdown cell becomes its own <br>, so a blank line inside a value survives. FEATURES.md now names Markdown and HTML among the export formats and among those kept while masking applies.
cevheri
approved these changes
Oct 6, 2026
cevheri
left a comment
Member
There was a problem hiding this comment.
Thanks, this works well in both shells and the escaping holds up. I pushed a small commit: FEATURES.md now lists Markdown and HTML, and a blank line inside a cell keeps its own
.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Markdown and HTML result export formats to both shells (
Studio.tsxandStudioWorkspace.tsx). Both formats follow the shared value contract of the existing CSVexporter, so a value that appears one way in the grid and the CSV reads the same way in the
Markdown table and the HTML table.
Closes #1532
What changed
src/lib/export/markdown.tsrenders a pipe table with a header row and a---separator row.src/lib/export/html.tsrenders a complete standalone document: a<table>inside a minimalHTML shell with embedded CSS.
ResultExportFormatgainsmarkdownandhtml. Both are text formats, so they use the existingResultExportFileshape and are written throughdownloadText.BottomPanel.tsxoffers both formats in the Export menu and in the Copy-to-clipboard menu.Studio.tsxandStudioWorkspace.tsxkeep one sharedbuildExportSourceper shell, so maskingand agent-artifact hydration apply to the new formats exactly as they apply to CSV, JSON and the
SQL formats.
Value rendering
Both writers reuse the shared cell contract (
renderValueinsrc/lib/export/csv.ts):nullandundefinedbecome an empty cell.Datevalues become their ISO string.\xhex the grid and CSV show.jsonText, which is bigint-safe and cycle-safe.String(value).Escaping
\and|in every cell and header cell, and replaces\nand\rwith<br>so a cell value cannot break the table row.&,<,>,"and'in every cell and header cell.Empty results
Tests
tests/unit/lib/export/markdown.test.ts(17 tests): escaping, header and separator rows,newline handling and the empty-result matrix.
tests/unit/lib/export/html.test.ts(14 tests): entity escaping, the standalone document shapeand the empty-result matrix.
tests/unit/lib/export/result-export.test.tsgains Markdown and HTML integration coveragethrough
buildResultExport.tests/unit/components/bottom-panel-formats.test.tspins the shared format list.tests/components/studio/bottom-panel-export-formats.test.tsx(13 tests) pins the Export andCopy menu items across dialects.
Verification
bun run typecheck: cleanbun run lint: 0 errorsbun run knip: cleanbun run build: succeeds