Is markdown="0" only used by kramdown?

#1

I am currently using markdown="0" for span tags to prevent the Markdown parser from changing TeX which is supposed to be parsed by MathJax (see Ignore LaTeX-like Math mode (or parse it) for a related discussion).

I am now thinking about changing from the static site generator Jekyll to Pelican. Hence I’m thinking if this approach might be a problem.

0 Likes

#2

[disclaimer: following is all untested.]

Pelican is using Python-markdown, which defaults to not parsing inside HTML, but has (buggy) support for markdown="1" with the extra extension, which Pelican enables by default.
Unfortunately, it seems to ignore the attribute value — markdown="0" makes it parse content as if it was markdown="1". So using 0 would not be portable to Pelican, you’d have to drop the attribute. I assume Python-Markdown’s author would welcome a fix.

But instead of protecting math with the <span>$A_{i,j}$</span> trick, you can teach Python-Markdown / Pelican to not parse inside math.
See https://www.ceremade.dauphine.fr/~amic/blog/mathjax-pelican-ii.html.
I’m not sure but it seems you need both https://github.com/getpelican/pelican-plugins/tree/master/render_math Pelican plugin and https://github.com/mayoff/python-markdown-mathjax extension (or similar, e.g. https://github.com/mitya57/python-markdown-math).

1 Like

#3

Thank you very much! I will have a look at the links as soon as other things are ready for the migration (might take a while). It’s good to have a starting point :slightly_smiling:

0 Likes

#4

Also, all implementations present in Babelmark that support markdown="0" (i.e. Kramdown and Maruku) fail to parse markdown=0.

0 Likes

#5

I’ve added this topic to the list of proposed extensions under “Disabling Syntax Parsing”.

1 Like