multiplex_test.js 810 B

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