arturadib / strapdown

Instant and elegant Markdown documents in the browser
http://strapdownjs.com
MIT License
2.48k stars 410 forks source link

Odd bug in combination with MathJax #20

Closed ghost closed 10 years ago

ghost commented 11 years ago

strapdown and MathJax usually work perfectly together, but not with an expression like: $$a_n \sum_{i}$$ The problems seems to be ther {} around the i. Without, it works. Also without the an before it does (even with the {}'s). Strange problem since both of these Versions work: `$$a \sum{i}$$ $$a_n \sum_i$$` Same problem with \prod instead of \sum by the way. The problem doesn't lie with MathJax, I checked.

edit: minimal example: http://leastaction.org/strapdown_bug.html

memeplex commented 11 years ago

This is not a bug. Just look at the output of marked for your markdown:

marked(markdown) => <ul><li>works: $$a \sum_{i}$$</li><li>works: $$a_n \sum_i$$</li><li>doesn&#39;t: $$a<em>n \sum</em>{i}$$</li></ul>

Do you see the 's? Now read http://daringfireball.net/projects/markdown/syntax#em and you will understand.

You just need to escape special characters sometimes: http://daringfireball.net/projects/markdown/syntax#backslash.

Please close this one.