LaravelTest
49 строк · 1.3 Кб
1// CodeMirror, copyright (c) by Marijn Haverbeke and others
2// Distributed under an MIT license: https://codemirror.net/LICENSE
3
4(function() {5CodeMirror.defineMode("markdown_with_stex", function(){6var inner = CodeMirror.getMode({}, "stex");7var outer = CodeMirror.getMode({}, "markdown");8
9var innerOptions = {10open: '$',11close: '$',12mode: inner,13delimStyle: 'delim',14innerStyle: 'inner'15};16
17return CodeMirror.multiplexingMode(outer, innerOptions);18});19
20var mode = CodeMirror.getMode({}, "markdown_with_stex");21
22function MT(name) {23test.mode(24name,25mode,26Array.prototype.slice.call(arguments, 1),27'multiplexing');28}29
30MT(31"stexInsideMarkdown",32"[strong **Equation:**] [delim&delim-open $][inner&tag \\pi][delim&delim-close $]");33
34CodeMirror.defineMode("identical_delim_multiplex", function() {35return CodeMirror.multiplexingMode(CodeMirror.getMode({indentUnit: 2}, "javascript"), {36open: "#",37close: "#",38mode: CodeMirror.getMode({}, "markdown"),39parseDelimiters: true,40innerStyle: "q"41});42});43
44var mode2 = CodeMirror.getMode({}, "identical_delim_multiplex");45
46test.mode("identical_delimiters_with_parseDelimiters", mode2, [47"[keyword let] [def x] [operator =] [q #foo][q&em *bar*][q #];"48], "multiplexing")49})();50