笙默考试管理系统-MyExamTest----codemirror(61)
笙默考试管理系统-MyExamTest----codemirror(61)
??
目录
一、 笙默考试管理系统-MyExamTest----codemirror
二、 笙默考试管理系统-MyExamTest----codemirror
三、 笙默考试管理系统-MyExamTest----codemirror
四、 笙默考试管理系统-MyExamTest----codemirror
五、 笙默考试管理系统-MyExamTest----codemirror
function inText(stream, state) {
????????function chain(parser) {
????????????state.tokenize = parser;
????????????return parser(stream, state);
????????}
????????var ch = stream.next();
????????if (ch == "<") {
????????????if (stream.eat("!")) {
????????????????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)) {
????????????????????stream.eatWhile(/[\w\._\-]/);
????????????????????return chain(doctype(1));
????????????????}
????????????????else return null;
????????????}
????????????else if (stream.eat("?")) {
????????????????stream.eatWhile(/[\w\._\-]/);
????????????????state.tokenize = inBlock("meta", "?>");
????????????????return "meta";
????????????}
????????????else {
????????????????type = stream.eat("/") ? "closeTag" : "openTag";
????????????????stream.eatSpace();
????????????????tagName = "";
????????????????var c;
????????????????while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c;
????????????????state.tokenize = inTag;
????????????????return "tag";
????????????}
????????}
????????else if (ch == "&") {
????????????stream.eatWhile(/[^;]/);
????????????stream.eat(";");
????????????return "atom";
????????}
????????else {
????????????stream.eatWhile(/[^&<]/);
????????????return null;
????????}
????}
????function inTag(stream, state) {
????????var ch = stream.next();
????????if (ch == ">" || (ch == "/" && stream.eat(">"))) {
????????????state.tokenize = inText;
????????????type = ch == ">" ? "endTag" : "selfcloseTag";
????????????return "tag";
????????}
????????else if (ch == "=") {
????????????type = "equals";
????????????return null;
????????}
????????else if (/[\'\"]/.test(ch)) {
????????????state.tokenize = inAttribute(ch);
????????????return state.tokenize(stream, state);
????????}
????????else {
????????????stream.eatWhile(/[^\s\u00a0=<>\"\'\/?]/);
????????????return "word";
????????}
????}
????function inAttribute(quote) {
????????return function(stream, state) {
????????????while (!stream.eol()) {
????????????????if (stream.next() == quote) {
????????????????????state.tokenize = inTag;
????????????????????break;
????????????????}
????????????}
????????????return "string";
????????};
????}
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。 如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:veading@qq.com进行投诉反馈,一经查实,立即删除!