Create a note containing inline math formulas, e.g. $\frac{1}{n}$.
Copy that line.
Paste it into the middle of the document (not at the end).
Edit the pasted line (for example, add or delete a character).
→ The inline formula disappears.
Expected behavior:
The pasted inline formula should remain rendered and editable.
Actual behavior:
The inline math element disappears when editing after paste.
Technical observation:
After inspecting with Developer Tools, we found that the cmView property of the formula’s DOM element disappears after editing.
This seems to cause the update event not to trigger, so the raw formula text is not re-rendered as MathJax.
It looks like the editor loses the binding between the math span and CodeMirror’s view.
Temporary workaround:
Switching to Source mode allows copying and pasting without this issue, but it’s inconvenient to toggle every time.
The same behavior can be reproduced in the sandbox vault.
I’m not entirely sure if any extra actions were taken when pasting the text. For example, in the image above, when pasting a line of text, only the \LaTeX formula element lacks the cmView field. Through breakpoint debugging, it was found that this prevents reading the element’s overrideDOMText, resulting in the corresponding text not appearing in the final output.
As mentioned above, not all formulas disappear. For example, the summation formula (\sum) in the demo GIF does not disappear, but \LaTeX does. You can refer to the operation steps in the GIF in the link.
At the same time, there are other unknown conditions for reproduction. For example, in the demo below, copying text to the bottom is normal. However, copying to the top causes problems:
I don’t doubt that it is happening, but I can’t make it happen in my vault or sandbox. I can copy ‘line with $\LaTeX$ formula’ to anywhere in the file and edit the line without the formula disappearing.
I imagine the team will need the debug info (Help > Show Debug Info). Could it be a font? Language setting? Version of Obsidian? Etc…