Fixes #215 - Marko v3: Marko should be case sensitive with tag names and attributes

This commit is contained in:
Patrick Steele-Idem 2016-02-03 14:34:41 -07:00
parent 3fb36e8094
commit d3f18a020e
2 changed files with 6 additions and 8 deletions

View File

@ -32,7 +32,7 @@ class HtmlAttributeCollection {
}
if (name) {
this.lookup[name.toLowerCase()] = newAttr;
this.lookup[name] = newAttr;
}
this.all.push(newAttr);
@ -41,8 +41,6 @@ class HtmlAttributeCollection {
removeAttribute(name) {
ok(typeof name === 'string', 'Invalid attribute name');
name = name.toLowerCase();
if (!this.lookup.hasOwnProperty(name)) {
return false;
}
@ -61,7 +59,7 @@ class HtmlAttributeCollection {
}
renameAttribute(oldName, newName) {
var key = oldName.toLowerCase();
var key = oldName;
var attr = this.lookup[key];
if (!attr) {
@ -75,7 +73,7 @@ class HtmlAttributeCollection {
hasAttribute(name) {
ok(typeof name === 'string', 'Invalid attribute name');
return this.lookup.hasOwnProperty(name.toLowerCase());
return this.lookup.hasOwnProperty(name);
}
hasAttributes() {
@ -83,7 +81,7 @@ class HtmlAttributeCollection {
}
getAttribute(name) {
return this.lookup[name.toLowerCase()];
return this.lookup[name];
}
setAttributeValue(name, value) {

View File

@ -153,7 +153,7 @@ class TaglibLookup {
}
var tagName = element.tagName;
return tags[tagName.toLowerCase()];
return tags[tagName];
}
getAttribute(element, attr) {
@ -234,7 +234,7 @@ class TaglibLookup {
};
}
var tagName = element.tagName.toLowerCase();
var tagName = element.tagName;
/*
* If the node is an element node then we need to find all matching
* transformers based on the URI and the local name of the element.