File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Sources/HTMLKitUtilityMacros Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ enum HTMLElements : DeclarationMacro {
172172 } else if value_type == " String " || value_type == " Int " || value_type == " Float " || value_type == " Double " {
173173 attributes_func += " \n "
174174 let value : String = value_type == " String " ? key : " String(describing: \( key) ) "
175- attributes_func += #"if let \#( key) { items.append(" \#( key ) =\\\"" + \#( value) + "\\\"") }"#
175+ attributes_func += #"if let \#( key) { items.append(" \#( key_literal ) =\\\"" + \#( value) + "\\\"") }"#
176176 attributes_func += " \n "
177177 } else {
178178 attributes_func += " \n "
Original file line number Diff line number Diff line change @@ -253,6 +253,13 @@ extension ElementTests {
253253 #expect( string == " <input accept= \" .docx,.json \" > " )
254254 }
255255
256+ // MARK: label
257+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label
258+ @Test func _label( ) {
259+ let string : StaticString = #html( label ( for: " what_the " , " skrrt " ) )
260+ #expect( string == " <label for= \" what_the \" >skrrt</label> " )
261+ }
262+
256263 // MARK: link
257264 // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link
258265 @Test func _link( ) {
You can’t perform that action at this time.
0 commit comments