kerzol / markdown-mathjax

Live markdown editor based on MathJax and Marked
https://kerzol.github.io/markdown-mathjax/editor.html
Other
117 stars 33 forks source link

\_ #1

Open kerzol opened 10 years ago

kerzol commented 10 years ago
$\_ asd \_ $

does not look good.

kerzol commented 10 years ago

Actually I do this: text = this.buffer.innerHTML; this.buffer.innerHTML = marked (text); and marked parses text inside HTML tags. So something like

$\text{ trata **bold** *italic*}$

works good.

But(!) for example

$\_$ 

produces no output... Because of that parsing. Maybe we should prevent markdown parsing within tags.

kerzol commented 10 years ago

Check this

$\_$ italic? $\_$
kerzol commented 10 years ago

Well, it seems that we must use Davide Cervone's approach in order to get good output from markdown+MathJax filter:

"The main idea is to strip out the math (and replace by tokens) then run Markdown, then replace the tokens by the original math afterward"

Davide even provides the following script:

http://www.math.union.edu/~dpvc/transfer/mathjax/mathjax-editing.js

But i don't sure about its license.

Also Davide wrote: "I was going to include it as part of a sample in the MathJax examples directory, and the rest of MathJax is Apache2" ( http://stackoverflow.com/questions/11228558/let-pagedown-and-mathjax-work-together#comment17378458_11231030 )

Do we have any news about this example?

-- Sergey

meghprkh commented 10 years ago

You can see my fork. Currently there are some issues, but it works

kerzol commented 8 years ago

@gdalgas from Stack Overflow just released StackExchange MathJax editing code under MIT Licence