Skip to content

Add Markdown+TeX validator (validateMarkdown library + vitest gate)#81

Merged
PatrikBak merged 1 commit intomainfrom
markdown-validator
May 10, 2026
Merged

Add Markdown+TeX validator (validateMarkdown library + vitest gate)#81
PatrikBak merged 1 commit intomainfrom
markdown-validator

Conversation

@PatrikBak
Copy link
Copy Markdown
Owner

@PatrikBak PatrikBak commented May 10, 2026

Summary

  • Extracts the renderer's unified() pipeline (plugins + sanitize schema) into a shared markdown-pipeline.ts so <RichMathEditorRenderer> and the new validateMarkdown library function call the same factory — validator-pass = render-pass becomes structural, not aspirational.
  • Adds a 29-fixture vitest snapshot gate covering the realistic content surface (paragraphs, math, lists, figures, spoilers, quotes, links, tables) plus 14 distinct KaTeX failure modes (unknown command, unbalanced braces, mismatched env, etc.).
  • validateMarkdown is the library entry point future tooling will call directly. No CLI — consumers import the library.

🤖 Generated with Claude Code

…ibrary

Both <RichMathEditorRenderer> and the new validateMarkdown library call
the same unified() plugin/schema factory in markdown-pipeline.ts, so
validator-pass is structurally guaranteed to match render-pass. Adds a
29-fixture vitest snapshot gate covering the realistic content surface
(paragraphs, math, lists, figures, spoilers, quotes, links, tables) and
14 KaTeX failure modes. Future migration and bulk-import code imports
validateMarkdown directly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 10, 2026

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

Project Deployment Actions Updated (UTC)
math-comps Ready Ready Preview, Comment May 10, 2026 1:29am

@PatrikBak PatrikBak merged commit 2141d62 into main May 10, 2026
4 checks passed
@PatrikBak PatrikBak deleted the markdown-validator branch May 10, 2026 01:33
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