plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

MathJax interferes with Markdown fences

Open jywarren opened this issue 9 years ago • 9 comments

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:

screenshot 2017-03-28 at 12 27 39 pm

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.

jywarren avatar Mar 28 '17 15:03 jywarren

I would like to help for this. Will start reading MathJax documentation and inform about suggestions.

aspriya avatar Apr 06 '17 15:04 aspriya

According to this post we may need to change the CDN https://www.mathjax.org/cdn-shutting-down/

aspriya avatar Apr 06 '17 17:04 aspriya

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 .

jywarren avatar Apr 06 '17 17:04 jywarren

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 .

jywarren avatar Apr 06 '17 17:04 jywarren

Yep, it's there. https://www.npmjs.com/package/mathjax

aspriya avatar Apr 06 '17 18:04 aspriya

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 .

jywarren avatar Apr 10 '17 19:04 jywarren

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.

aspriya avatar Apr 13 '17 11:04 aspriya

Doing that solved the issue. now it is rendering correctly as follows. selection_111

aspriya avatar Apr 13 '17 11:04 aspriya

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 .

jywarren avatar Apr 13 '17 13:04 jywarren