Inline math disappears when a line of text is edited after pasting

In certain situations when I paste a line of text containing inline equations, edits to the text cause the equation(s) to disappear.

Steps to reproduce

  1. Make sure obsidian is not in source mode
  2. Copy and paste the following string: “a$2$ b”
  3. [Enter] to next line.
  4. Move the cursor to the start of the first line and press [enter] to add a new line above.
  5. Move to the line above (now the first list item) and paste the same text
  6. Press the spacebar (or add any other character)

Did you follow the troubleshooting guide? Yes

Expected result

  • a$2$ b
  • a$2$ b

Actual result

  • a b
  • a$2$ b

Environment

SYSTEM INFO:
Obsidian version: v1.9.14
Installer version: v1.8.10
Operating system: Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:27 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T8103 23.3.0
Login status: logged in
Language: en
Catalyst license: none
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

As far as I can tell this only occurs when

  • the text is pasted (it doesn’t happen when I type the exact same text).
  • the edit is at least one character outside an inline equation (so the equation “source” is never shown with the $). But if there are multiple inline equations, editing one will make the other(s) disappear.
  • obsidian is not in source mode (inline equations are rendered).

Other things:

  • It’s most consistent when the pasted text is identical to the text on the next line (sometimes it seems to occur even when this isn’t the case).
  • It doesn’t always remove all of the equations.

I think this is the same problem as this.

If you still have this problem once you get 1.10.2, let me know