Last active
August 29, 2015 14:21
-
-
Save jquense/e83122e14dc04d4d0ba0 to your computer and use it in GitHub Desktop.
Code mirror jsx mode
This file contains 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
.cm-s-monokai .cm-tag.cm-error, | |
.cm-s-monokai .cm-bracket.cm-error { | |
color: #f92672; | |
background: transparent; | |
} |
This file contains 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
CodeMirror.defineMode("jsx", function(config) { | |
return CodeMirror.multiplexingMode( | |
CodeMirror.getMode(config, "javascript"), | |
{ | |
open: '<', close: '>', | |
mode: CodeMirror.multiplexingMode( | |
CodeMirror.getMode(config, { name: "xml", htmlMode: true }), | |
{ | |
open: "{", close: "}", | |
mode: CodeMirror.getMode(config, "javascript"), | |
parseDelimiters: false | |
}), | |
parseDelimiters: true | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment