notebook icon indicating copy to clipboard operation
notebook copied to clipboard

Javascript in markdown renders incorrectly.

Open madrury-galvanize opened this issue 8 years ago • 5 comments
trafficstars

This chunk of javascript code in a markdown cell (using the mongodb api)

db.unicorns.update({
    name: "Rarity"}, {
    $push: {
        friends: {
            $each: ["TwilightSparkle", "Applejack", "Fluttershy"]}}}, {
    upsert: true})

renders incorrectly if tagged explicitly as a javascript snippet:

db.unicorns.update({
    name: "Rarity"}, {
    @@0@@each: ["TwilightSparkle", "Applejack", "Fluttershy"]}}}, {
    upsert: true})

I'm running version:

$ jupyter --version
4.3.0

madrury-galvanize avatar Jul 19 '17 15:07 madrury-galvanize

Looks like our maths parsing going wrong :-(

takluyver avatar Jul 19 '17 15:07 takluyver

Ahhh, the two dollar signs, I missed that.

It does work properly in a code block when I do not explicitly call out javascript. So it seems like calling out the language is disabling some guard against mathjax parsing.

madrury-galvanize avatar Jul 19 '17 18:07 madrury-galvanize

I'd guess that the Javascript highlight breaks the replacement that would put the 'maths' back in there in place of @@0@@.

takluyver avatar Jul 19 '17 20:07 takluyver

Any progress on this? It is rather annoying since dollar signs are an important part of code and one cannot really escape them somehow in a code cell.

mforbes avatar Jul 04 '20 19:07 mforbes

Does this still occur with current Jupyter Notebook? If not, please close.

slel avatar Jul 07 '22 12:07 slel