codemirror 3.14

This commit is contained in:
ilvalle
2013-06-21 16:03:20 +02:00
parent 1d38b87719
commit 867c99469c
38 changed files with 3374 additions and 1638 deletions
+14 -18
View File
@@ -58,20 +58,19 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
if (stream.eat("[")) {
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
else return null;
}
else if (stream.match("--")) return chain(inBlock("comment", "-->"));
else if (stream.match("DOCTYPE", true, true)) {
} else if (stream.match("--")) {
return chain(inBlock("comment", "-->"));
} else if (stream.match("DOCTYPE", true, true)) {
stream.eatWhile(/[\w\._\-]/);
return chain(doctype(1));
} else {
return null;
}
else return null;
}
else if (stream.eat("?")) {
} else if (stream.eat("?")) {
stream.eatWhile(/[\w\._\-]/);
state.tokenize = inBlock("meta", "?>");
return "meta";
}
else {
} else {
var isClose = stream.eat("/");
tagName = "";
var c;
@@ -81,8 +80,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
state.tokenize = inTag;
return "tag";
}
}
else if (ch == "&") {
} else if (ch == "&") {
var ok;
if (stream.eat("#")) {
if (stream.eat("x")) {
@@ -94,8 +92,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
}
return ok ? "atom" : "error";
}
else {
} else {
stream.eatWhile(/[^&<]/);
return null;
}
@@ -107,16 +104,15 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
state.tokenize = inText;
type = ch == ">" ? "endTag" : "selfcloseTag";
return "tag";
}
else if (ch == "=") {
} else if (ch == "=") {
type = "equals";
return null;
}
else if (/[\'\"]/.test(ch)) {
} else if (ch == "<") {
return "error";
} else if (/[\'\"]/.test(ch)) {
state.tokenize = inAttribute(ch);
return state.tokenize(stream, state);
}
else {
} else {
stream.eatWhile(/[^\s\u00a0=<>\"\']/);
return "word";
}