Skip to content

Conversation

@KyleKing
Copy link
Owner

@KyleKing KyleKing commented Nov 22, 2025

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

claude and others added 2 commits November 22, 2025 05:45
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
@KyleKing KyleKing requested a review from Copilot November 22, 2025 06:55
Copilot finished reviewing on behalf of KyleKing November 22, 2025 06:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ($...$, (...)) and block ($$...$$, [...], \begin{env}...\end{env}) delimiter support
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.

claude and others added 9 commits November 23, 2025 04:57
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.
@KyleKing KyleKing changed the title fix: close out ticket with final changes fix(#45): add math support Nov 28, 2025
@KyleKing KyleKing merged commit 726cf28 into main Nov 28, 2025
7 checks passed
@KyleKing KyleKing deleted the claude/close-ticket-01WRMm2ihEHEoG7X3qj3QzAd branch November 28, 2025 12:39
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.

Formatting Issues with mdformat-mkdocs

3 participants