| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others |
| 2 | -// Distributed under an MIT license: https://codemirror.net/LICENSE | |
| 2 | +// Distributed under an MIT license: http://codemirror.net/LICENSE | |
| 3 | 3 | |
| 4 | 4 | (function(mod) { |
| 5 | 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS |
| 6 | 6 | mod(require("../../lib/codemirror")); |
| @@ -51,9 +51,8 @@ | ||
| 51 | 51 | contextGrabbers: {}, |
| 52 | 52 | doNotIndent: {}, |
| 53 | 53 | allowUnquoted: false, |
| 54 | 54 | allowMissing: false, |
| 55 | - allowMissingTagName: false, | |
| 56 | 55 | caseFold: false |
| 57 | 56 | } |
| 58 | 57 | |
| 59 | 58 | CodeMirror.defineMode("xml", function(editorConf, config_) { |
| @@ -162,11 +161,10 @@ | ||
| 162 | 161 | } |
| 163 | 162 | stream.next(); |
| 164 | 163 | } |
| 165 | 164 | return style; |
| 166 | - } | |
| 165 | + }; | |
| 167 | 166 | } |
| 168 | - | |
| 169 | 167 | function doctype(depth) { |
| 170 | 168 | return function(stream, state) { |
| 171 | 169 | var ch; |
| 172 | 170 | while ((ch = stream.next()) != null) { |
| @@ -188,9 +186,9 @@ | ||
| 188 | 186 | } |
| 189 | 187 | |
| 190 | 188 | function Context(state, tagName, startOfLine) { |
| 191 | 189 | this.prev = state.context; |
| 192 | - this.tagName = tagName || ""; | |
| 190 | + this.tagName = tagName; | |
| 193 | 191 | this.indent = state.indented; |
| 194 | 192 | this.startOfLine = startOfLine; |
| 195 | 193 | if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) |
| 196 | 194 | this.noIndent = true; |
| @@ -227,11 +225,8 @@ | ||
| 227 | 225 | if (type == "word") { |
| 228 | 226 | state.tagName = stream.current(); |
| 229 | 227 | setStyle = "tag"; |
| 230 | 228 | return attrState; |
| 231 | - } else if (config.allowMissingTagName && type == "endTag") { | |
| 232 | - setStyle = "tag bracket"; | |
| 233 | - return attrState(type, stream, state); | |
| 234 | 229 | } else { |
| 235 | 230 | setStyle = "error"; |
| 236 | 231 | return tagNameState; |
| 237 | 232 | } |
| @@ -248,11 +243,8 @@ | ||
| 248 | 243 | } else { |
| 249 | 244 | setStyle = "tag error"; |
| 250 | 245 | return closeStateErr; |
| 251 | 246 | } |
| 252 | - } else if (config.allowMissingTagName && type == "endTag") { | |
| 253 | - setStyle = "tag bracket"; | |
| 254 | - return closeState(type, stream, state); | |
| 255 | 247 | } else { |
| 256 | 248 | setStyle = "error"; |
| 257 | 249 | return closeStateErr; |
| 258 | 250 | } |
| @@ -389,19 +381,8 @@ | ||
| 389 | 381 | |
| 390 | 382 | skipAttribute: function(state) { |
| 391 | 383 | if (state.state == attrValueState) |
| 392 | 384 | state.state = attrState |
| 393 | - }, | |
| 394 | - | |
| 395 | - xmlCurrentTag: function(state) { | |
| 396 | - return state.tagName ? {name: state.tagName, close: state.type == "closeTag"} : null | |
| 397 | - }, | |
| 398 | - | |
| 399 | - xmlCurrentContext: function(state) { | |
| 400 | - var context = [] | |
| 401 | - for (var cx = state.context; cx; cx = cx.prev) | |
| 402 | - context.push(cx.tagName) | |
| 403 | - return context.reverse() | |
| 404 | 385 | } |
| 405 | 386 | }; |
| 406 | 387 | }); |
| 407 | 388 | |