goessner / markdown-it-texmath

Support TeX math equations with your Markdown documents.
MIT License
161 stars 29 forks source link

Space out immediately after the left dollar #38

Closed nosuke23 closed 2 years ago

nosuke23 commented 2 years ago

If spaces are after the left dollar, the string isn't parse to TeX math.

md().use(tm).render("$a$") // <p><eq>...</eq></p>
md().use(tm).render("$ a$") // <p>$ a$</p> 
goessner commented 2 years ago

This is by intention to allow markup using $'s besides math:

It costs 5$ or 8$.

So with inline math leading and trailing spaces are not allowed.

nosuke23 commented 2 years ago

I got it. Sorry, but I have one more question about the following.

md().use(tm).render("$hoges$") // <p>$hoges$</p> 
md().use(tm).render("$hoges $") // <p><eq>...</eq></p>

If there is "s" before the last $, it's not too.

goessner commented 2 years ago

oops ... can't reproduce. Would you please be so kind and check, if you use the latest version "0.9.7" ?

nosuke23 commented 2 years ago

please see here.

goessner commented 2 years ago

cool ... please switch to current version "0.9.7" ...

nosuke23 commented 2 years ago

Isn't the latest version "0.9.6" ?

goessner commented 2 years ago

just verified, that "0.9.7" wasn't published yet ... now it is ... sorry.

nosuke23 commented 2 years ago

it worked! thank you for your work.