Permalink
Browse files

Make htmlmixed properly check for "tag" style

This allows the xml mode to return a style with space separated classes
and still work. I didn't use /\btag\b/ since that can match "tag-foo".
  • Loading branch information...
xeenon authored and marijnh committed Nov 26, 2012
1 parent 36c763b commit 5da226e88bca0ed5a202ffd4163555c7fc0bfe2d
Showing with 1 addition and 1 deletion.
  1. +1 −1 mode/htmlmixed/htmlmixed.js
@@ -5,7 +5,7 @@ CodeMirror.defineMode("htmlmixed", function(config) {
function html(stream, state) {
var style = htmlMode.token(stream, state.htmlState);
- if (style == "tag" && stream.current() == ">" && state.htmlState.context) {
+ if (/(?:^|\s)tag(?:\s|$)/.test(style) && stream.current() == ">" && state.htmlState.context) {
if (/^script$/i.test(state.htmlState.context.tagName)) {
state.token = javascript;
state.localState = jsMode.startState(htmlMode.indent(state.htmlState, ""));

0 comments on commit 5da226e

Please sign in to comment.