From 16b7404d9bc2f9ba264f140310948897689fe3ca Mon Sep 17 00:00:00 2001 From: goatchurch Date: Sun, 28 Jun 2009 21:26:35 +0100 Subject: [svn] horrid .svns copied accidentally --- media/CodeMirror-0.62/js/parsehtmlmixed.js | 74 ++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 media/CodeMirror-0.62/js/parsehtmlmixed.js (limited to 'media/CodeMirror-0.62/js/parsehtmlmixed.js') diff --git a/media/CodeMirror-0.62/js/parsehtmlmixed.js b/media/CodeMirror-0.62/js/parsehtmlmixed.js new file mode 100644 index 0000000..ed1a608 --- /dev/null +++ b/media/CodeMirror-0.62/js/parsehtmlmixed.js @@ -0,0 +1,74 @@ +var HTMLMixedParser = Editor.Parser = (function() { + if (!(CSSParser && JSParser && XMLParser)) + throw new Error("CSS, JS, and XML parsers must be loaded for HTML mixed mode to work."); + XMLParser.configure({useHTMLKludges: true}); + + function parseMixed(stream) { + var htmlParser = XMLParser.make(stream), localParser = null, inTag = false; + var iter = {next: top, copy: copy}; + + function top() { + var token = htmlParser.next(); + if (token.content == "<") + inTag = true; + else if (token.style == "xml-tagname" && inTag === true) + inTag = token.content.toLowerCase(); + else if (token.content == ">") { + if (inTag == "script") + iter.next = local(JSParser, "