Commit eb0a9bc9 by Rocky Duan

only run customwmd when where's markdown

parent 1a57ac50
$ ->
if Markdown?
mathRenderer = new MathJaxDelayRenderer()
removeMath = (text) -> text
replaceMath = (text) -> text
updateMathJax = ->
console.log "updating"
#mathRenderer.render
# element: $("#wmd-preview")
MathJax.Hub.Queue(["Typeset", MathJax.Hub, "wmd-preview"])
converter = Markdown.getSanitizingConverter()
editor = new Markdown.Editor(converter)
#converter.hooks.chain "preConversion", removeMath
converter.hooks.chain "preConversion", removeMath
converter.hooks.chain "postConversion", replaceMath
editor.hooks.chain "onPreviewRefresh", updateMathJax
editor.run()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment