Created
May 20, 2011 22:38
-
-
Save c-spencer/983950 to your computer and use it in GitHub Desktop.
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
// in Mode | |
var highlighter = new MarkdownHighlightRules(); | |
this.$tokenizer = new Tokenizer(highlighter.getRules()); | |
this.$embeds = highlighter.getEmbeds(); | |
this.createModeDelegates({ | |
"js-": JavaScriptMode | |
}); | |
// in Highlighter | |
this.embedRules(JavaScriptHighlightRules, "js-", [{ | |
token : "constant", | |
regex : "^```", | |
next : "start" | |
}]); | |
// Whenever in a js- state, mode callbacks will be delegated to the javascript mode. | |
// The escape rule is also added to every js-state, to avoid being missed by a multiline state. | |
// (can pass an array of states to escape from optionally) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment