File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ function camelCase(name) {
142
142
143
143
var SINGLE_TAG_REGEXP = / ^ < ( \w + ) \s * \/ ? > (?: < \/ \1> | ) $ / ;
144
144
var HTML_REGEXP = / < | & # ? \w + ; / ;
145
- var TAG_NAME_REGEXP = / < ( [ \w : ] + ) / ;
145
+ var TAG_NAME_REGEXP = / < ( [ \w : - ] + ) / ;
146
146
var XHTML_TAG_REGEXP = / < (? ! a r e a | b r | c o l | e m b e d | h r | i m g | i n p u t | l i n k | m e t a | p a r a m ) ( ( [ \w : ] + ) [ ^ > ] * ) \/ > / gi;
147
147
148
148
var wrapMap = {
Original file line number Diff line number Diff line change @@ -78,6 +78,19 @@ describe('jqLite', function() {
78
78
} ) ;
79
79
80
80
81
+ it ( 'should properly handle dash-delimited node names' , function ( ) {
82
+ var nodes = jqLite ( '<custom-element>Hello, world !</custom-element>' ) ;
83
+ expect ( nodes . length ) . toBe ( 1 ) ;
84
+ expect ( nodes [ 0 ] . nodeName . toLowerCase ( ) ) . toBe ( 'custom-element' ) ;
85
+ expect ( nodes [ 0 ] . innerHTML ) . toBe ( 'Hello, world !' ) ;
86
+
87
+ nodes = jqLite ( '<tr-custom>Hello, world !</tr-custom>' ) ;
88
+ expect ( nodes . length ) . toBe ( 1 ) ;
89
+ expect ( nodes [ 0 ] . nodeName . toLowerCase ( ) ) . toBe ( 'tr-custom' ) ;
90
+ expect ( nodes [ 0 ] . innerHTML ) . toBe ( 'Hello, world !' ) ;
91
+ } ) ;
92
+
93
+
81
94
it ( 'should allow creation of comment tags' , function ( ) {
82
95
var nodes = jqLite ( '<!-- foo -->' ) ;
83
96
expect ( nodes . length ) . toBe ( 1 ) ;
You can’t perform that action at this time.
0 commit comments