Converter P0+P1: tables, images, escape, h4-h6, hr, mark/sub/sup, code lang hints + Vitest harness + CI#1
Merged
Merged
Conversation
P0 (correctness, conversion coverage): - Tables → GFM table syntax (handles thead-or-first-row header, escapes pipes) - Markdown special chars in text nodes are now escaped so "5 * 3 = 15" no longer renders as italic - Images →  (with optional title) - Headings extended to h4–h6 - <hr> → --- P1 quick wins: - <mark>, <sub>, <sup> emit HTML pass-through (renders everywhere Markdown allows raw HTML) - <pre>/<code> reads data-language and class="language-xyz" for fenced-code language hints - <del> joins <s>/<strike> for strikethrough - Final whitespace pass collapses runs of 3+ blank lines to two P2 (testability + CI): - Vitest + jsdom harness loads index.html as the artifact under test, so tests exercise the actual published page rather than a duplicate. End users still just open index.html. - 34 unit tests covering headings, inline formatting, escaping, images, tables, code blocks, lists, links, and whitespace cleanup. - tests/fixtures/<source>/*.html ⇄ *.expected.md auto-discovery for real-world paste regression coverage - GitHub Actions CI runs cspell, html-validate, and vitest on PRs README updated with full feature list, privacy note, and contributor instructions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
Author
|
@claude review |
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
Aimed at making paste-to-markdown handle real Notion / Airtable / Google Docs pastes without dropping content or silently corrupting it. Plan reference:
~/.claude/plans/great-now-what-else-sprightly-pony.md.P0 — correctness and core coverage
thead/tbody/tr/th/td, falls back to "first row is header" if nothead, escapes|in cells, recurses for inline formatting.\ ` * _ [ ] ~in text nodes only (not inside<code>/<pre>).— were dropped entirely. Title attribute included if present.<hr>→---— was dropped.P1 quick wins
<mark>,<sub>,<sup>emit HTML pass-through (renders anywhere Markdown allows raw HTML).<pre>readsdata-language(Notion) andclass="language-xyz"(Prism convention) for fenced-code language hints.<del>joins<s>/<strike>for strikethrough.<div>s used to produce big gaps).P2 — testability + CI
index.htmlitself as the artifact under test, so tests exercise the actual published page rather than a duplicate. End users still just openindex.html— no install needed.tests/fixtures/<source>/<scenario>.htmlpaired with<scenario>.expected.mdand the harness picks them up. Highest-leverage investment for regression safety as new sources are supported.Out of scope for this PR (P3, design-coordinated)
Test plan
npm test— all 34 tests pass locallynpm run lint:spell— cleannpm run lint:html— clean*/_/[in prose; confirm output is correct🤖 Generated with Claude Code