File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed
HTMLKitParse/extensions/html Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,11 @@ public enum HTMLAttribute : HTMLInitializable {
5050 case slot( String ? = nil )
5151 case spellcheck( Extra . spellcheck ? = nil )
5252
53- #if canImport(CSS)
53+ /* #if canImport(CSS)
5454 case style([CSSStyle]? = nil)
55- #else
55+ #else*/
5656 case style( String ? = nil )
57- #endif
57+ // #endif
5858
5959 case tabindex( Int ? = nil )
6060 case title( String ? = nil )
@@ -169,11 +169,11 @@ public enum HTMLAttribute : HTMLInitializable {
169169 case . slot( let value) : return value
170170 case . spellcheck( let value) : return value? . rawValue
171171
172- #if canImport(CSS)
172+ /* #if canImport(CSS)
173173 case .style(let value): return value?.compactMap({ $0.htmlValue(encoding: encoding, forMacro: forMacro) }).joined(separator: ";")
174- #else
174+ #else*/
175175 case . style( let value) : return value
176- #endif
176+ // #endif
177177
178178 case . tabindex( let value) : return value? . description
179179 case . title( let value) : return value
Original file line number Diff line number Diff line change @@ -52,9 +52,11 @@ extension HTMLAttribute : HTMLParsable {
5252 case " slot " : self = . slot( string ( ) )
5353 case " spellcheck " : self = . spellcheck( enumeration ( ) )
5454
55- #if canImport(CSS)
55+ /* #if canImport(CSS)
5656 case "style": self = .style(context.arrayEnumeration())
57- #endif
57+ #else*/
58+ case " style " : self = . style( context. string ( ) )
59+ //#endif
5860
5961 case " tabindex " : self = . tabindex( context. int ( ) )
6062 case " title " : self = . title( string ( ) )
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ struct CSSTests {
1414
1515 @Test func cssAttribute( ) {
1616 let expected : String = " <div style= \" white-space:normal \" ></div> "
17- let result : String = #html( div ( attributes: [ . style( [ . whiteSpace( . normal) ] ) ] ) )
17+ //let result:String = #html(div(attributes: [.style([.whiteSpace(.normal)])]))
18+ let result : String = #html( div ( attributes: [ . style( " white-space:normal " ) ] ) )
1819 #expect( expected == result)
1920 }
2021
You can’t perform that action at this time.
0 commit comments