Skip to content
Snippets Groups Projects
Commit d22b757e authored by eustas's avatar eustas Committed by Marijn Haverbeke
Browse files

HTML: reduce error distribution for incorrect / unfinished entities

parent d46bd84f
No related branches found
No related tags found
No related merge requests found
......@@ -47,9 +47,17 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
}
}
else if (ch == "&") {
stream.eatWhile(/[^;]/);
stream.eat(";");
return "atom";
var ok;
if (stream.eat("#")) {
if (stream.eat("x")) {
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
} else {
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
}
} else {
ok = stream.eatWhile(/[\w]/) && stream.eat(";");
}
return ok ? "atom" : "error";
}
else {
stream.eatWhile(/[^&<]/);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment