From c782cb327fad9e27527202ee12debe35bd8272bc Mon Sep 17 00:00:00 2001 From: Lorenzo Gasparini Date: Wed, 1 Mar 2017 23:38:31 +0100 Subject: [PATCH] Swap $ and $$ delimiters order to avoid conflicts. --- notebook/static/notebook/js/codemirror-ipythongfm.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/notebook/static/notebook/js/codemirror-ipythongfm.js b/notebook/static/notebook/js/codemirror-ipythongfm.js index 9a6bbc36b..fb2fb60df 100644 --- a/notebook/static/notebook/js/codemirror-ipythongfm.js +++ b/notebook/static/notebook/js/codemirror-ipythongfm.js @@ -33,14 +33,15 @@ return CodeMirror.multiplexingMode( gfm_mode, + // By defining the $$ delimiter before the $ delimiter we don't run + // into the problem that $$ is interpreted as two consecutive $. { - open: "$", close: "$", + open: "$$", close: "$$", mode: tex_mode, delimStyle: "delimit" }, { - // not sure this works as $$ is interpreted at (opening $, closing $, as defined just above) - open: "$$", close: "$$", + open: "$", close: "$", mode: tex_mode, delimStyle: "delimit" },