mirror of
https://github.com/documize/community.git
synced 2025-08-04 21:15:24 +02:00
CodeMirror upgrade to 5.38.0
This commit is contained in:
parent
36be6243ad
commit
cfe30dcde5
52 changed files with 905 additions and 413 deletions
12
gui/public/codemirror/mode/stex/stex.js
vendored
12
gui/public/codemirror/mode/stex/stex.js
vendored
|
@ -78,6 +78,14 @@
|
|||
plugins["begin"] = addPluginPattern("begin", "tag", ["atom"]);
|
||||
plugins["end"] = addPluginPattern("end", "tag", ["atom"]);
|
||||
|
||||
plugins["label" ] = addPluginPattern("label" , "tag", ["atom"]);
|
||||
plugins["ref" ] = addPluginPattern("ref" , "tag", ["atom"]);
|
||||
plugins["eqref" ] = addPluginPattern("eqref" , "tag", ["atom"]);
|
||||
plugins["cite" ] = addPluginPattern("cite" , "tag", ["atom"]);
|
||||
plugins["bibitem" ] = addPluginPattern("bibitem" , "tag", ["atom"]);
|
||||
plugins["Bibitem" ] = addPluginPattern("Bibitem" , "tag", ["atom"]);
|
||||
plugins["RBibitem" ] = addPluginPattern("RBibitem" , "tag", ["atom"]);
|
||||
|
||||
plugins["DEFAULT"] = function () {
|
||||
this.name = "DEFAULT";
|
||||
this.style = "tag";
|
||||
|
@ -117,6 +125,10 @@
|
|||
setState(state, function(source, state){ return inMathMode(source, state, "\\]"); });
|
||||
return "keyword";
|
||||
}
|
||||
if (source.match("\\(")) {
|
||||
setState(state, function(source, state){ return inMathMode(source, state, "\\)"); });
|
||||
return "keyword";
|
||||
}
|
||||
if (source.match("$$")) {
|
||||
setState(state, function(source, state){ return inMathMode(source, state, "$$"); });
|
||||
return "keyword";
|
||||
|
|
9
gui/public/codemirror/mode/stex/test.js
vendored
9
gui/public/codemirror/mode/stex/test.js
vendored
|
@ -111,9 +111,18 @@
|
|||
MT("inlineMath",
|
||||
"[keyword $][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword $] other text");
|
||||
|
||||
MT("inlineMathLatexStyle",
|
||||
"[keyword \\(][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword \\)] other text");
|
||||
|
||||
MT("displayMath",
|
||||
"More [keyword $$]\t[variable-2 S][tag ^][variable-2 n][tag \\sum] [variable-2 i][keyword $$] other text");
|
||||
|
||||
MT("displayMath environment",
|
||||
"[tag \\begin][bracket {][atom equation][bracket }] x [tag \\end][bracket {][atom equation][bracket }] other text");
|
||||
|
||||
MT("displayMath environment with label",
|
||||
"[tag \\begin][bracket {][atom equation][bracket }][tag \\label][bracket {][atom eq1][bracket }] x [tag \\end][bracket {][atom equation][bracket }] other text~[tag \\ref][bracket {][atom eq1][bracket }]");
|
||||
|
||||
MT("mathWithComment",
|
||||
"[keyword $][variable-2 x] [comment % $]",
|
||||
"[variable-2 y][keyword $] other text");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue