Fixed math block delimiter in section parser extension

This commit is contained in:
benweet 2013-11-20 10:05:17 +00:00
parent 7c0e6f74e7
commit 93772da821

View File

@ -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) {