feat: add math-delimiter validator - #22
Open
m-messer wants to merge 1 commit into
Open
Conversation
New in2lambda.validation package that checks the #/## markdown contract for
unbalanced or misplaced KaTeX math delimiters before conversion:
- validation/delimiters.py: math_delimiter_checker() scans markdown char by
char and returns a MathDelimiterError enum member (PASSED on success).
- validation/__init__.py: check_markdown() aggregates checks into a list of
problems, ready to be surfaced as warnings by the Markdown filter and the
wizard.
Ported from conversion2025/tools and testing/{validator,validator_classes}.py
on the Summer2025 branch; the sentinel exception classes are replaced with an
enum. All of that branch's validator_tests.py cases are ported to
tests/test_validation.py.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017VXb8aZqgFBjoeuuddjW6r
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.
New
in2lambda.validationpackage that checks the#/##markdown contract for unbalanced or misplaced KaTeX math delimiters before conversion.validation/delimiters.py:math_delimiter_checker()scans markdown char by char and returns aMathDelimiterErrorenum member (PASSEDon success).validation/__init__.py:check_markdown()aggregates checks into a list of problems, ready to be surfaced as warnings by the Markdown filter and the wizard.conversion2025/toolsandtesting/{validator,validator_classes}.pyonSummer2025; sentinel exception classes replaced with an enum. All of that branch'svalidator_tests.pycases ported totests/test_validation.py.Stack: test-harness ← validator ← markdown-filter ← …
Base:
test-harness— review/merge #21 first.🤖 Generated with Claude Code