Skip to content

Commit ad1de62

Browse files
committed
[xml mode] Lookup HTML tag properties in a cast-insensitive way
Closes #6779
1 parent 8a25b23 commit ad1de62

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

mode/xml/xml.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
205205
return;
206206
}
207207
parentTagName = state.context.tagName;
208-
if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
209-
!config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
208+
if (!config.contextGrabbers.hasOwnProperty(parentTagName.toLowerCase()) ||
209+
!config.contextGrabbers[parentTagName.toLowerCase()].hasOwnProperty(nextTagName.toLowerCase())) {
210210
return;
211211
}
212212
popContext(state);
@@ -240,7 +240,7 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
240240
if (type == "word") {
241241
var tagName = stream.current();
242242
if (state.context && state.context.tagName != tagName &&
243-
config.implicitlyClosed.hasOwnProperty(state.context.tagName))
243+
config.implicitlyClosed.hasOwnProperty(state.context.tagName.toLowerCase()))
244244
popContext(state);
245245
if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
246246
setStyle = "tag";
@@ -279,7 +279,7 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
279279
var tagName = state.tagName, tagStart = state.tagStart;
280280
state.tagName = state.tagStart = null;
281281
if (type == "selfcloseTag" ||
282-
config.autoSelfClosers.hasOwnProperty(tagName)) {
282+
config.autoSelfClosers.hasOwnProperty(tagName.toLowerCase())) {
283283
maybePopContext(state, tagName);
284284
} else {
285285
maybePopContext(state, tagName);
@@ -359,16 +359,16 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
359359
if (context.tagName == tagAfter[2]) {
360360
context = context.prev;
361361
break;
362-
} else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
362+
} else if (config.implicitlyClosed.hasOwnProperty(context.tagName.toLowerCase())) {
363363
context = context.prev;
364364
} else {
365365
break;
366366
}
367367
}
368368
} else if (tagAfter) { // Opening tag spotted
369369
while (context) {
370-
var grabbers = config.contextGrabbers[context.tagName];
371-
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
370+
var grabbers = config.contextGrabbers[context.tagName.toLowerCase()];
371+
if (grabbers && grabbers.hasOwnProperty(tagAfter[2].toLowerCase()))
372372
context = context.prev;
373373
else
374374
break;

0 commit comments

Comments
 (0)