File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export default function h(name, attrs) {
2323 let s = `<${ name } ` ;
2424 if ( attrs ) for ( let i in attrs ) {
2525 if ( attrs [ i ] !== false && attrs [ i ] != null ) {
26- s += ` ${ esc ( i ) } ="${ esc ( attrs [ i ] ) } "` ;
26+ s += ` ${ i === 'className' ? 'class' : esc ( i ) } ="${ esc ( attrs [ i ] ) } "` ;
2727 }
2828 }
2929
Original file line number Diff line number Diff line change @@ -157,4 +157,12 @@ describe('vhtml', () => {
157157 `<div><area><base><br><col><command><embed><hr><img><input><keygen><link><meta><param><source><track><wbr><div></div><span></span><p></p></div>`
158158 ) ;
159159 } ) ;
160+
161+ it ( 'should handle className as class' , ( ) => {
162+ expect (
163+ < div className = "my-class" />
164+ ) . to . equal (
165+ '<div class="my-class"></div>'
166+ ) ;
167+ } ) ;
160168} ) ;
You can’t perform that action at this time.
0 commit comments