2015-05-04 03:53:29 -04:00
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
|
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
|
|
|
|
|
|
(function() {
|
|
|
|
CodeMirror.defineMode("markdown_with_stex", function(){
|
|
|
|
var inner = CodeMirror.getMode({}, "stex");
|
|
|
|
var outer = CodeMirror.getMode({}, "markdown");
|
|
|
|
|
|
|
|
var innerOptions = {
|
|
|
|
open: '$',
|
|
|
|
close: '$',
|
|
|
|
mode: inner,
|
|
|
|
delimStyle: 'delim',
|
|
|
|
innerStyle: 'inner'
|
|
|
|
};
|
|
|
|
|
|
|
|
return CodeMirror.multiplexingMode(outer, innerOptions);
|
|
|
|
});
|
|
|
|
|
|
|
|
var mode = CodeMirror.getMode({}, "markdown_with_stex");
|
|
|
|
|
|
|
|
function MT(name) {
|
|
|
|
test.mode(
|
|
|
|
name,
|
|
|
|
mode,
|
|
|
|
Array.prototype.slice.call(arguments, 1),
|
|
|
|
'multiplexing');
|
|
|
|
}
|
|
|
|
|
|
|
|
MT(
|
|
|
|
"stexInsideMarkdown",
|
2016-01-17 15:28:04 -05:00
|
|
|
"[strong **Equation:**] [delim&delim-open $][inner&tag \\pi][delim&delim-close $]");
|
2015-05-04 03:53:29 -04:00
|
|
|
})();
|