Skip to content

Fix Math input errors and remove Edit frames - #12

Merged
yuema137 merged 1 commit into
mainfrom
fix/mathml-rendering-and-edit-appearance
Sep 10, 2026
Merged

yuema137 merged 1 commit into
mainfrom
fix/mathml-rendering-and-edit-appearance

Conversation

@yuema137

Copy link
Copy Markdown
Owner

Some make4ht formulas contain bare text directly inside MathML math/mrow elements. When the asynchronous MathJax loader finishes early enough, its MathML input processor turns these into “Math input error” (60 failures in the reported manuscript). The previous fast browser test could finish before this happened.

Rebuild annotated formulas from their stored TeX into native MathML, which also avoids document-level CHTML stylesheet dependencies inside the manuscript shadow root. Handle both loader timing orders, preserve renderer output for unsupported custom macros, and avoid overwriting pending user math edits or a replaced projection.

Also remove the Edit-mode container frame and editable-text focus outline, as requested by the user, without removing contenteditable behavior.

Validation and review:

  • All four Python tests pass; JS syntax and diff checks pass.
  • Extended Chromium regression explicitly waits for MathJax and checks no bare MathML tokens or error nodes, no Edit frame/focus outline, and retained editing capability.
  • Both the deliberately malformed mixed-math fixture and the actual 92-formula manuscript pass editing, comment creation, JSON persistence, reload, and Refresh checks. Test feedback uses temporary projects.
  • Reviewed asynchronous replacement guards and fallback behavior for TeX macros unknown to MathJax. No canonical manuscript changes; no additional runtime dependency.

Browser coverage is Chromium. This PR does not claim cross-browser testing or provide offline MathJax distribution.

@yuema137
yuema137 merged commit 907d50b into main Sep 10, 2026
4 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.

1 participant