You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
833 B

  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&delim-open $][inner&tag \\pi][delim&delim-close $]");
  27. })();