mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Fixes #215 - Marko v3: Marko should be case sensitive with tag names and attributes
This commit is contained in:
parent
3fb36e8094
commit
d3f18a020e
@ -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) {
|
||||
|
||||
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user