RyotaUshio / obsidian-latex-theorem-equation-referencer

A powerful indexing & referencing system for theorems & equations in your Obsidian vault.
https://ryotaushio.github.io/obsidian-latex-theorem-equation-referencer/
MIT License
147 stars 6 forks source link

fix(equation numbering): skip newlines after comments to prevent commenting out lines #182

Closed pepega-hacker closed 9 months ago

pepega-hacker commented 9 months ago

screencast.webm

In latex '%' comments out the line, so removing all newlines in a math block breaks it. A simple fix is to just prepend negative lookbehinds to original regexp.

pepega-hacker commented 9 months ago

oh i just realised its supposed to be u^7/7 :face_palm:

RyotaUshio commented 9 months ago

Hi, thanks a lot for pointing it out!

I also noticed bugs for cases other than the one you've fixed, so I entirely rewrote the insertTagInMathText() function. (It seems that removing line breaks was unnecessary (and harmful) in the first place...)

I'll release it as 1.0.4-beta soon. Let me know again if you find something's not working well!