File tree Expand file tree Collapse file tree
test/siesta/tests/functional Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ class HtmlStringToVdom extends Base {
148148 if ( attrName === 'class' ) {
149149 attrName = 'cls' ;
150150 } else if ( attrName === 'style' ) {
151- vdom . style = this . parseStyle ( attrValue ) ;
151+ vdom . style = Neo . createStyleObject ( attrValue ) ;
152152 continue ;
153153 }
154154 vdom [ attrName ] = attrValue ;
@@ -173,23 +173,6 @@ class HtmlStringToVdom extends Base {
173173
174174 return null ; // Should not happen for valid HTML
175175 }
176-
177- /**
178- * Parses a style attribute string into an object.
179- * @param {String } styleString The style string (e.g., "color: red; font-size: 16px").
180- * @returns {Object } The style object.
181- * @private
182- */
183- parseStyle ( styleString ) {
184- const style = { } ;
185- styleString . split ( ';' ) . forEach ( declaration => {
186- if ( declaration . trim ( ) !== '' ) {
187- const [ property , value ] = declaration . split ( ':' ) ;
188- style [ property . trim ( ) ] = value . trim ( ) ;
189- }
190- } ) ;
191- return style ;
192- }
193176}
194177
195178export default Neo . setupClass ( HtmlStringToVdom ) ;
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ StartTest(t => {
4343 cls : 'foo bar' ,
4444 style : {
4545 color : 'red' ,
46- 'font-size' : '16px'
46+ fontSize : '16px'
4747 }
4848 } ) ;
4949 } ) ;
You can’t perform that action at this time.
0 commit comments