File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 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) {
175175function isNode ( tagName , value ) {
176176 var type = value . type ;
177177
178+ if ( typeof type === 'string' ) {
179+ type = type . toLowerCase ( ) ;
180+ }
181+
178182 if ( tagName === 'input' || ! type || typeof type !== 'string' ) {
179183 return false ;
180184 }
Original file line number Diff line number Diff line change @@ -722,6 +722,24 @@ test('hastscript', function (t) {
722722 'a button has a valid type'
723723 ) ;
724724
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+
725743 st . deepEqual (
726744 h ( 'button' , {
727745 'type' : 'menu' ,
You can’t perform that action at this time.
0 commit comments