Skip to content

Fix #45: TeX option serialization regression for grouped expressions#46

Open
wesleyel wants to merge 2 commits intocolinc86:mainfrom
gradpath-app:main
Open

Fix #45: TeX option serialization regression for grouped expressions#46
wesleyel wants to merge 2 commits intocolinc86:mainfrom
gradpath-app:main

Conversation

@wesleyel
Copy link
Copy Markdown

#45

This pull request refactors how TeX options are handled in the MathJaxSwift converters and adds new tests to ensure valid TeX expressions do not generate error nodes in the output. The main changes include centralizing TeX option normalization, updating all converters to use this new normalization function, and adding tests for grouped TeX expressions.

Refactoring and Centralization of TeX Options:

  • Added a new normalizeTeXOptions function in texOptions.js to centralize and standardize the handling of TeX options, including package selection and regex conversion for the digits option. All converters now use this function instead of duplicating logic.
  • Updated chtml.js, svg.js, and mml.js to use normalizeTeXOptions for TeX input processing, removing direct manipulation of the AllPackages list and simplifying option handling. [1] [2] [3] [4] [5] [6]

Bug Fixes and Improvements:

  • Fixed the default TeX digit-matching regex in TeXInputProcessorOptions.swift to correctly escape braces and dots, ensuring proper parsing of numbers in TeX input.

Testing Improvements:

  • Added new tests in Tex2CHTMLTests.swift, Tex2MMLTests.swift, and Tex2SVGTests.swift to verify that valid grouped TeX expressions do not emit error nodes in the generated output for each format. [1] [2] [3]

Copilot AI and others added 2 commits April 20, 2026 09:23
Agent-Logs-Url: https://github.com/wesleyel/MathJaxSwift/sessions/1a55a5a3-bce1-4639-9b63-878d9f9f212b

Co-authored-by: wesleyel <48174882+wesleyel@users.noreply.github.com>
…or-regression

Fix TeX option serialization regression that broke valid grouped expressions
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