File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,10 @@ function addChild(nodes, value) {
175
175
function isNode ( tagName , value ) {
176
176
var type = value . type ;
177
177
178
+ if ( typeof type === 'string' ) {
179
+ type = type . toLowerCase ( ) ;
180
+ }
181
+
178
182
if ( tagName === 'input' || ! type || typeof type !== 'string' ) {
179
183
return false ;
180
184
}
Original file line number Diff line number Diff line change @@ -722,6 +722,24 @@ test('hastscript', function (t) {
722
722
'a button has a valid type'
723
723
) ;
724
724
725
+ st . deepEqual (
726
+ h ( 'button' , {
727
+ 'type' : 'BUTTON' ,
728
+ 'value' : 'Send'
729
+ } ) ,
730
+ {
731
+ 'type' : 'element' ,
732
+ 'tagName' : 'button' ,
733
+ 'properties' : {
734
+ 'type' : 'BUTTON' ,
735
+ 'value' : 'Send'
736
+ } ,
737
+ 'children' : [ ]
738
+ } ,
739
+ 'should *not* allow omitting `properties` when ' +
740
+ 'a button has a valid non-lowercase type'
741
+ ) ;
742
+
725
743
st . deepEqual (
726
744
h ( 'button' , {
727
745
'type' : 'menu' ,
You can’t perform that action at this time.
0 commit comments