Skip to content

Commit 5a214a9

Browse files
committed
Add support for non-lowercase tag-names
Previously, all tag-names were lower-cased, however, this behaviour conflicts with SVG tag-names. To allow camel-cased SVG tag-names, the limitation was lifted, and case normalisation no longer occurs.
1 parent 15fdd1f commit 5a214a9

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function parse(selector) {
7878
}
7979
}
8080

81-
node.tagName = name.toLowerCase();
81+
node.tagName = name;
8282

8383
if (id) {
8484
node.properties.id = id;

test.js

+11
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,16 @@ test('parseSelector()', function (t) {
9797
'should return the last ID if multiple are found'
9898
);
9999

100+
t.deepEqual(
101+
parseSelector('Foo'),
102+
{
103+
'type': 'element',
104+
'tagName': 'Foo',
105+
'properties': {},
106+
'children': []
107+
},
108+
'should *not* case the tag-name'
109+
);
110+
100111
t.end();
101112
});

0 commit comments

Comments
 (0)