mdiep / MMMarkdown

An Objective-C framework for converting Markdown to HTML.
MIT License
1.25k stars 168 forks source link

Add test for mathjax markup #55

Closed techiaith closed 9 years ago

techiaith commented 9 years ago

Some Markdown parsers I've found incorrectly convert _ to <em> and various other things. MMMarkdown doesn't (great!) but I thought it would be worth having a test to keep it this way

http://www.mathjax.org/

mdiep commented 9 years ago

I like to keep tests as focused as possible. What specific failures are these guarding against? I think the test can probably be more focused to those failures.

techiaith commented 9 years ago

Specifically, to avoid _ being considered for italic. I know some implementations allow both * and _ to be used for emphasis, but I guess MMMarkdown is only using * (which I agree with), and hence why these tests currently succeed.

The other is that backslashes aren't escaped or unescaped.

mdiep commented 9 years ago

MMMarkdown does consider _ to be for italics. But since this test only has 1 _, it's not used for italics.

techiaith commented 9 years ago

Oh OK, I stand corrected. I guess the test, therefore, is that the inclusion of only 1 _ doesn't convert the rest of the phrase to italics

mdiep commented 9 years ago

Based on that, I don't feel comfortable adding this test. I think the real answer here is to add proper support for mathjax via an extension.

But thanks for submitting this pull request! :sparkles: