vendor/assets/javascripts/codemirror/modes/xml.js in codemirror-rails-3.18 vs vendor/assets/javascripts/codemirror/modes/xml.js in codemirror-rails-3.19
- old
+ new
@@ -74,11 +74,11 @@
} else {
var isClose = stream.eat("/");
tagName = "";
var c;
while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c;
- if (!tagName) return "error";
+ if (!tagName) return "tag error";
type = isClose ? "closeTag" : "openTag";
state.tokenize = inTag;
return "tag";
}
} else if (ch == "&") {
@@ -107,11 +107,13 @@
return "tag";
} else if (ch == "=") {
type = "equals";
return null;
} else if (ch == "<") {
- return "error";
+ state.tokenize = inText;
+ var next = state.tokenize(stream, state);
+ return next ? next + " error" : "error";
} else if (/[\'\"]/.test(ch)) {
state.tokenize = inAttribute(ch);
state.stringStartCol = stream.column();
return state.tokenize(stream, state);
} else {
@@ -296,10 +298,12 @@
var comb = state.cc.pop() || element;
if (comb(type || style)) break;
}
}
state.startOfLine = false;
- return setStyle || style;
+ if (setStyle)
+ style = setStyle == "error" ? style + " error" : setStyle;
+ return style;
},
indent: function(state, textAfter, fullLine) {
var context = state.context;
// Indent multi-line strings (e.g. css).