miyuchina / mistletoe

A fast, extensible and spec-compliant Markdown parser in pure Python.
MIT License
818 stars 118 forks source link

fix inline mathjax handling #195

Closed chrisbresten closed 9 months ago

chrisbresten commented 11 months ago

previously it was converting mathjax unsupported inline math delimiters $ to block math delimiters $$ which are not equivalent. here it instead converts inline math delim $ to the mathjax supported inline math delim \( \) which have the expected equivalent behavior

pbodnar commented 10 months ago

@chrisbresten, would you like to finish the small "cosmetic modifications" as suggested above, or can I take it over? :)

chrisbresten commented 9 months ago

@chrisbresten, would you like to finish the small "cosmetic modifications" as suggested above, or can I take it over? :)

hi, i am sorry for the slow response. I am not that well versed in the style conventions and cleanliness standards for production in this context so i had kind of deferred to you implicitly. I should have stated this.

chrisbresten commented 9 months ago

i checked my local copy and found changes to unit tests to reflect the new behavior properly. I defer to you @pbodnar for any changes that help maintain standards and style consistent with the codebase at large

coveralls commented 9 months ago

Coverage Status

coverage: 94.162% (+0.09%) from 94.073% when pulling 62d81047330705ff49a77166c0acea360af3c03c on chrisbresten:inline_mathjax into 70e8e8dbc24b836e554f46e7f23c2cabc7dbd77a on miyuchina:master.

pbodnar commented 9 months ago

@chrisbresten, thanks once again. I did the final amendments and hopefully didn't break anything. ;)

pbodnar commented 9 months ago

BTW I have found this cool "cheatsheet" for the MathJax syntax: https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference/.

chrisbresten commented 9 months ago

BTW I have found this cool "cheatsheet" for the MathJax syntax: https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference/.

thankyou. I write a lot of latex and there can be a lot of variation in what kind of syntax people choose to use out of habbit. there are a lot of options for some functionality due to improvements manifesting as new commands in order to leave the old ones for backward compatibility. also a lot of packages people use so ubiquitously that they forget the corresponding functionality is not builtin. mathjax seems to do a good job at keeping a pulse on this and providing a math environment that is compliant with this implicit standard