diff --git a/public/res/extensions/markdownSectionParser.js b/public/res/extensions/markdownSectionParser.js index 750c2619..eea886a0 100644 --- a/public/res/extensions/markdownSectionParser.js +++ b/public/res/extensions/markdownSectionParser.js @@ -25,11 +25,11 @@ define([ } if(mathJax.config.enabled) { // Math delimiter has to follow 1 empty line to be considered as a section delimiter - regexp = '^[ \\t]*\\n[ \\t]*\\$\\$[\\s\\S]*?\\$\\$|' + regexp; // $$ math delimiters - regexp = '^[ \\t]*\\n[ \\t]*\\\\\\\\[[\\s\\S]*?\\\\\\\\]|' + regexp; // \\[ \\] math delimiters - regexp = '^[ \\t]*\\n[ \\t]*\\\\?\\\\begin\\{[a-z]*\\*?\\}[\\s\\S]*?\\\\end\\{[a-z]*\\*?\\}|' + regexp; // \\begin{...} \\end{...} math delimiters + regexp = '^[ \\t]*\\n\\$\\$[\\s\\S]*?\\$\\$|' + regexp; // $$ math block delimiters + regexp = '^[ \\t]*\\n\\\\\\\\[[\\s\\S]*?\\\\\\\\]|' + regexp; // \\[ \\] math block delimiters + regexp = '^[ \\t]*\\n\\\\?\\\\begin\\{[a-z]*\\*?\\}[\\s\\S]*?\\\\end\\{[a-z]*\\*?\\}|' + regexp; // \\begin{...} \\end{...} math block delimiters } - regexp = new RegExp(regexp, 'gmi'); + regexp = new RegExp(regexp, 'gm'); var converter = editor.getConverter(); converter.hooks.chain("preConversion", function(text) {