MathJax interferes with Markdown fences
What happened just before the problem occurred
@Khamba posted some code with code fences, like:
// code here
You can see the original raw markdown code here: https://publiclab.org/notes/raw/14004
But the mathjax library we've added parsed it and tried to evaluate it as a latex math expression, and caused an error:

Mathjax is included here: https://github.com/publiclab/plots2/blob/master/app/views/layouts/application.html.erb#L20
@vincegando had previously set Mathjax to use the default delimiters: https://github.com/publiclab/plots2/commit/e09451e3d2daf772e434eeeaed75e8437ba694e9
I wonder if we can specify things differently to avoid conflicting with code fences? I think we need to read some of the MathJax documentation to check.
I would like to help for this. Will start reading MathJax documentation and inform about suggestions.
According to this post we may need to change the CDN https://www.mathjax.org/cdn-shutting-down/
awesome, thanks!
On Thu, Apr 6, 2017 at 11:53 AM, Ashan Priyadarshana < [email protected]> wrote:
I would like to help for this. Will start reading MathJax documentation and inform about suggestions.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1358#issuecomment-292218972, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJw22B-ue5XrGMGkCvBmUtiJ0cNIgks5rtQpfgaJpZM4MrzMg .
Ah -- can you look on npmjs.org to see if we can just include it directly?
On Thu, Apr 6, 2017 at 1:44 PM, Ashan Priyadarshana < [email protected]> wrote:
According to this post we may need change the CDN https://www.mathjax.org/cdn-shutting-down/
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1358#issuecomment-292252739, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ6KQT513TiMRepoOq4yyKpe4BZZCks5rtSR6gaJpZM4MrzMg .
Yep, it's there. https://www.npmjs.com/package/mathjax
oh great -- well, we should be able to link to it either by its name or by direct URL in https://github.com/publiclab/plots2/blob/master/bower.json -- and then change the URL that had been pointing to the CDN version. Can you give that a try?
On Thu, Apr 6, 2017 at 2:57 PM, Ashan Priyadarshana < [email protected]> wrote:
Yep, it's there. https://www.npmjs.com/package/mathjax
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1358#issuecomment-292277251, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJwaX0ypqpXnm6slKS0j_oQA2pMRwks5rtTWVgaJpZM4MrzMg .
Oh found the issue. We are using RDiscount to render the markdown in published notes. And the issue is current rdiscount gem version does not support fencing code blocks with ```. Found these details using following articles.
article 1 :Here in Code section it says nothing about fecing code blocks with ```.
article 2 :Here it states that older versions of RDiscout does not support ``` fences.
So I will try including the current version of gem in Gemfile.
Doing that solved the issue. now it is rendering correctly as follows.

Fantastic!!! Great work!
On Apr 13, 2017 7:46 AM, "Ashan Priyadarshana" [email protected] wrote:
Doing that solved the issue. now it is rendering correctly as follows. [image: selection_111] https://cloud.githubusercontent.com/assets/13878973/25003406/dcb1db16-206c-11e7-81e8-8f8e21ff4145.png
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1358#issuecomment-293867276, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ5LqoBR8c6oZ9FJjRpX1EIxq7X18ks5rvgsjgaJpZM4MrzMg .