multiplex_test.js 834 B

123456789101112131415161718192021222324252627282930313233
  1. // CodeMirror, copyright (c) by Marijn Haverbeke and others
  2. // Distributed under an MIT license: https://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&delim-open $][inner&tag \\pi][delim&delim-close $]");
  27. })();