# [IPython-dev] ipython html notebook: markdown in math mode and backslashes

MinRK benjaminrk@gmail....
Thu Aug 23 11:41:57 CDT 2012

> What's wrong with fixing the Markdown processor as I proposed?

Nothing at all - markdown rendering absolutely has to be fixed, either with
an appropriate hook in the converter.js, or wrapped around handing it off
to pagedown.

It's a bit weird that they're using Pagedown for this, because it's mostly
> used for live previews, not rendering.

We don't want there to be any server communication involved in markdown
edits, so it has to be in javascript.

On Thu, Aug 23, 2012 at 8:13 AM, Aron Ahmadia <aron@ahmadia.net> wrote:

> I feel like a jerk, I just checked to see if this problem shows up on our
> own gitit+pagedown live renderer, and the same bug is present!  We use
> pandoc to do the final render, which is probably why I hadn't noticed it
> before.
>
> The StackExchange guys do some special parsing before they hand their code
> off to the PageDown parser, you can see it here:
>
> http://cdn.sstatic.net/js/mathjax-editing-new.js
>
> This is probably going to be the most familiar syntax for people used to
> LaTex and willing to work with Markdown for their outer formatting.
>
> Digging into the ipython source, the Markdown.converter is initialized in
> notebookmain.js then utilized in the textcell.js markdown render function.
>  I don't see any special parsing done for handling the math symbols.   I
> think the render function in textcell.js would be the right place to add
> the math delimiter strip/replace hooks.
>
> If you guys are interested, I can see about getting the SE
> mathjax-editing-new.js code licensed for redistribution, the SE guys are
> pretty hip to this kind of thing so I don't expect it to be a problem.
>

Yes, absolutely!  If they have already solved the problem, then let's use
an existing and proven solution.

-MinRK

>
> A
>
> On Thu, Aug 23, 2012 at 3:29 PM, Aron Ahmadia <aron@ahmadia.net> wrote:
>
>> It's a bit weird that they're using Pagedown for this, because it's
>> mostly used for live previews, not rendering.  Something must be
>> misconfigured, because Pagedown+MathJax is a pretty standard setup.  I'm
>> digging into the code now.
>>
>> A
>>
>>
>> On Thu, Aug 23, 2012 at 3:15 PM, Thomas Kluyver <takowl@gmail.com> wrote:
>>
>>> On 23 August 2012 15:13, Aron Ahmadia <aron@ahmadia.net> wrote:
>>> > Okay, if the notebook is using python-markdown, it might be as simple
>>> as
>>> > installing this extension:
>>>
>>> Unfortunately it's not. All the markdown processing happens in the
>>> browser, using Javascript. You can see the code for it here:
>>>
>>>
>>> https://github.com/ipython/ipython/blob/master/IPython/frontend/html/notebook/static/pagedown/Markdown.Converter.js
>>>
>>> Thanks,
>>> Thomas
>>> _______________________________________________
>>> IPython-dev mailing list
>>> IPython-dev@scipy.org
>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20120823/ad2ad6e7/attachment-0001.html


More information about the IPython-dev mailing list