openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

multiplex_test.js (833B)


      1 // CodeMirror, copyright (c) by Marijn Haverbeke and others
      2 // Distributed under an MIT license: http://codemirror.net/LICENSE
      3 
      4 (function() {
      5   CodeMirror.defineMode("markdown_with_stex", function(){
      6     var inner = CodeMirror.getMode({}, "stex");
      7     var outer = CodeMirror.getMode({}, "markdown");
      8 
      9     var innerOptions = {
     10       open: '$',
     11       close: '$',
     12       mode: inner,
     13       delimStyle: 'delim',
     14       innerStyle: 'inner'
     15     };
     16 
     17     return CodeMirror.multiplexingMode(outer, innerOptions);
     18   });
     19 
     20   var mode = CodeMirror.getMode({}, "markdown_with_stex");
     21 
     22   function MT(name) {
     23     test.mode(
     24       name,
     25       mode,
     26       Array.prototype.slice.call(arguments, 1),
     27       'multiplexing');
     28   }
     29 
     30   MT(
     31     "stexInsideMarkdown",
     32     "[strong **Equation:**] [delim&delim-open $][inner&tag \\pi][delim&delim-close $]");
     33 })();