Created
October 4, 2015 19:17
-
-
Save themeteorchef/9ae8bf296cfe6ee933d6 to your computer and use it in GitHub Desktop.
Multiplex in CodeMirror
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Taken from the source of the demo here: https://codemirror.net/demo/multiplex.html | |
| CodeMirror.defineMode("demo", function(config) { | |
| return CodeMirror.multiplexingMode( | |
| CodeMirror.getMode(config, "text/html"), | |
| {open: "<<", close: ">>", | |
| mode: CodeMirror.getMode(config, "text/plain"), | |
| delimStyle: "delimit"} | |
| // .. more multiplexed styles can follow here | |
| ); | |
| }); | |
| var editor = CodeMirror.fromTextArea(document.getElementById("code"), { | |
| mode: "demo", | |
| lineNumbers: true, | |
| lineWrapping: true | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment