-
Notifications
You must be signed in to change notification settings - Fork 740
Open
Labels
Description
Describe the bug
When editing math formulas with $$...$$ LaTeX delimiters in draw.io's rich text editor, the browser's contenteditable engine sometimes splits the formula text across multiple <span> elements. This causes MathJax to fail to recognize and render the formula, because MathJax's TeX input processor cannot match $$ delimiter pairs that span across different HTML element boundaries.
To Reproduce
- Open draw.io and enable Mathematical Typesetting (Extras → Mathematical Typesetting)
- Create a text element and type a LaTeX formula, e.g.
$$s_0 \to A_0 h_0$$ - Edit the formula — place the cursor in the middle of the formula, delete some characters, then retype them (or copy-paste part of the formula)
- After editing, the formula may stop rendering and instead displays as raw LaTeX text
The underlying cause can be seen in the saved .drawio XML. After editing, the cell value changes from a single <span> to multiple <span> elements:
Before editing (renders correctly):
<mxCell value="<span>$$s_0 \to A_0→h_0$$</span>" />After editing (fails to render):
<mxCell value="<span style="text-align: center; text-wrap: nowrap;">$$s_0 \to A_0&nbsp;&nbsp;</span><span style="text-align: center; text-wrap: nowrap; background-color: initial;">h_0$$</span>" />The opening $$ is in the first <span> and the closing $$ is in the second <span>, so MathJax cannot match them.
Environment
- draw.io version 26.0.9 (dev)
- OS: Windows 11
- Browser: Chrome
- Browser Version: 134
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Reactions are currently unavailable