Merged
Conversation
This commit implements complete solutions for all items in issue #45: 1. **Arithmatex Support (NEW)**: Implemented full PyMdown Extensions Arithmatex support for LaTeX/math expressions - Inline math: $...$ (smart dollar mode) and \(...\) - Block math: $$...$$, \[...\], and \begin{env}...\end{env} - Smart dollar mode prevents false positives (e.g., $3.00) - Comprehensive test coverage with 6 new test cases 2. ** Entity Replacement (DOCUMENTED)**: Added documentation explaining that conversion to Unicode is core mdformat behavior - Added "Known Behaviors" section to README - Documented CSS alternatives for spacing (padding, margin, gap, etc.) - Updated test fixture comments to explain behavior 3. **Attribute Lists (COMPLETED)**: Already fixed in previous commits - Attribute lists preserved when using --wrap mode - Updated outdated FIXME comments to accurate descriptions - All tests passing (165/165) Changes: - Added mdformat_mkdocs/mdit_plugins/_pymd_arithmatex.py - Added tests/format/fixtures/pymd_arithmatex.md - Updated README.md with Arithmatex support and Known Behaviors section - Updated plugin.py to register Arithmatex plugin - Updated test fixtures to remove outdated FIXME comments - All tests passing (165 passed, +6 new Arithmatex tests) Resolves #45
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements complete solutions for issue #45 by adding Arithmatex (math/LaTeX) support, documenting entity replacement behavior, and updating outdated comments about attribute lists.
- Added full PyMdown Extensions Arithmatex support for inline and block math expressions
- Documented known behavior regarding HTML entity conversion to Unicode
- Updated test fixtures to replace outdated FIXME comments with accurate descriptions
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| mdformat_mkdocs/mdit_plugins/_pymd_arithmatex.py | New plugin implementing Arithmatex math expression parsing with inline ( |
| tests/format/fixtures/pymd_arithmatex.md | New test fixtures covering 6 test cases for inline math, block math with various delimiters, and mixed math expressions |
| mdformat_mkdocs/mdit_plugins/init.py | Export new Arithmatex constants and plugin function |
| mdformat_mkdocs/plugin.py | Register Arithmatex plugin and renderers for inline and block math nodes |
| tests/format/test_format.py | Add pymd_arithmatex.md to test fixtures list |
| tests/render/fixtures/python_markdown_attr_list.md | Update comments from "FIXME" to "Note" explaining conversion behavior |
| tests/format/fixtures/python_markdown_attr_list.md | Update comments from "FIXME" to "Note" explaining conversion behavior |
| README.md | Document Arithmatex support features and add "Known Behaviors" section explaining HTML entity replacement with CSS alternatives |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replaced custom 214-line implementation with a 59-line wrapper around well-tested mdit-py-plugins (dollarmath, texmath, amsmath). Benefits: - 72% code reduction (214 → 59 lines) - Uses battle-tested, maintained upstream plugins - Simpler maintenance burden - Same functionality and test coverage - All 165 tests passing Technical changes: - mdformat_mkdocs/mdit_plugins/_pymd_arithmatex.py: - Now wraps dollarmath_plugin, texmath_plugin, amsmath_plugin - Removed custom regex parsing and token generation - Token types now: math_inline, math_block, amsmath - mdformat_mkdocs/plugin.py: - Added _render_math_inline(), _render_math_block(), _render_amsmath() - Uses token.markup to preserve original delimiters ($, $$, \(, \[, etc.) - Updated RENDERERS mapping This addresses the complexity concern raised in code 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.
This commit implements complete solutions for all items in issue #45:
Arithmatex Support (NEW): Implemented full PyMdown Extensions Arithmatex support for LaTeX/math expressions
Entity Replacement (DOCUMENTED): Added documentation explaining that conversion to Unicode is core mdformat behaviorAdded "Known Behaviors" section to READMEDocumented CSS alternatives for spacing (padding, margin, gap, etc.)Updated test fixture comments to explain behaviorAttribute Lists (COMPLETED): Already fixed in previous commits
Changes:
Resolves #45