nothingislost / obsidian-codemirror-options

Obsidian plugin with options to customize the behavior of CodeMirror
GNU General Public License v3.0
174 stars 13 forks source link

Feature Request: A way to disable LateX mode. #38

Closed chrisirhc closed 3 years ago

chrisirhc commented 3 years ago

When using 2 $ symbols within a sentence, looks like HyperMD thinks this is inline LateX: image

May I request a way to disable this behavior?

nothingislost commented 3 years ago

Ah, you're right. I'll get that fixed in the next release.

chrisirhc commented 3 years ago

I’m learning plugin development so if it’s something quick I can pick up (such as if you can point me to a commit with a relevant approach), happy to put a PR up.

nothingislost commented 3 years ago

This may not be the best issue to jump into as it involves modifying the markdown parser logic. If you're interested in how it works, the current logic starts here https://github.com/nothingislost/obsidian-codemirror-options/blob/4a99ef43eabcfbd75b36a0a18694c5070cc33aa4/src/hmd-mode.js#L324

I believe the regex on this line needs tuning https://github.com/nothingislost/obsidian-codemirror-options/blob/4a99ef43eabcfbd75b36a0a18694c5070cc33aa4/src/hmd-mode.js#L327

nothingislost commented 3 years ago

Fixed in 0.4.2