widcardw / obsidian-asciimath

Asciimath support for Obsidian (based on asciimath-parser)
MIT License
29 stars 3 forks source link

Plugin crashes obsidian when the rendered file contains ill input #26

Closed TheVroum closed 5 months ago

TheVroum commented 5 months ago

Hello ! Everything is in the title. No other plugins were activated. The plugin version is 0.7.2 and obsidian up to date as of writing. I attach to this message a file that can trigger such crash. Asciicrash3.md Thank you for your plugin, and thank you for your attention.

widcardw commented 5 months ago

In my debug, it must be the \n\n in the first math block, and I made a mistake when recognizing its token type.

Should it look like this?

image

\left\lbrace \begin{array}{ll} 
\exists \mathcal{ P } _{ 4 } \in \mathbb{R} \left[ X \right] \; \text{t.q.} \; \forall n \in \mathbb{N} & D _{ \mathcal{ L } _{ 1 } } \left( n \right) \cdot D _{ \mathcal{ L } _{ 2 } } \left( n \right) \\ 
\leqslant \left( \mathcal{ P } _{ 4 } \left( n \right) \right) ^{ 2 } = \mathcal{ P } _{ 5 } \in \mathbb{R} \left[ X \right] 
\end{array} \right.

If there is no problem, I will try to update its dependency and this plugin. Thank you for your bug report.

TheVroum commented 5 months ago

Yes that's how it should look like. Great, thank you. I will comment again when I receive the update if it is not fixed then.