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...
1 parent 8e23bc1 commit 8809bb52f3e0a1350a3be52d5654deb8d0a5a064 @xeenon xeenon committed with marijnh Nov 26, 2012
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 8809bb5

Please sign in to comment.