christianp / asciimath2tex

JavaScript library to convert AsciiMath to TeX
Apache License 2.0
70 stars 16 forks source link

Sequence "\ " ignored #14

Closed GiovanniSalmeri closed 2 years ago

GiovanniSalmeri commented 2 years ago

I suspect that in the method strip_space the regex should be corrected in /^(\s|\\(?!\\\s))*/. As it is now, the sequence \ is simply stripped, instead of being translated in \, (that is the thin space). The rendering in MathML seem to confirm that this is what should happen, and also MathJax does so. The examples in the tests where \ is used seem on the contrary not correct. Am I right?

christianp commented 2 years ago

Thanks for reporting this! It's fixed now.

GiovanniSalmeri commented 2 years ago

Thank you!