Skip to content

feat(parser): accept braced dimension arguments and \Space support - #67

Merged
carloskiki merged 4 commits into
carloskiki:mainfrom
gjtorikian:bucket-b/pr-8-braced-args
Jul 19, 2026
Merged

feat(parser): accept braced dimension arguments and \Space support#67
carloskiki merged 4 commits into
carloskiki:mainfrom
gjtorikian:bucket-b/pr-8-braced-args

Conversation

@gjtorikian

Copy link
Copy Markdown
Contributor

This PR is purely for MathJax / KaTeX compatability.

Plain TeX requires a bare form (e.g. \hskip 1em), but KaTeX and MathJax also tolerate \hskip{1em}. This PR adds lex::dimension_or_braced and lex::glue_or_braced wrappers that transparently unwrap a single {...} group around the dimension, and use them for \kern, \hskip, \mkern, \mskip.

It also adds the MathJax \Space{width}{height}{depth} MathJax extension. To support it, Event::Space gains a third depth: Option<Dimension> field, and the MathML writer now emits it as the depth attribute on <mspace> when present.

@codecov

codecov Bot commented Jun 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.94118% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.5%. Comparing base (d385cae) to head (0049651).

Files with missing lines Patch % Lines
src/parser/primitives.rs 83.3% 6 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/event.rs 75.5% <ø> (+1.4%) ⬆️
src/mathml.rs 81.1% <100.0%> (+<0.1%) ⬆️
src/parser/lex.rs 94.4% <100.0%> (+1.0%) ⬆️
src/parser/primitives.rs 85.4% <83.3%> (+1.6%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@carloskiki
carloskiki merged commit f0201db into carloskiki:main Jul 19, 2026
4 of 18 checks passed
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.

2 participants