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 {
172
172
} else if value_type == " String " || value_type == " Int " || value_type == " Float " || value_type == " Double " {
173
173
attributes_func += " \n "
174
174
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) + "\\\"") }"#
176
176
attributes_func += " \n "
177
177
} else {
178
178
attributes_func += " \n "
Original file line number Diff line number Diff line change @@ -253,6 +253,13 @@ extension ElementTests {
253
253
#expect( string == " <input accept= \" .docx,.json \" > " )
254
254
}
255
255
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
+
256
263
// MARK: link
257
264
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link
258
265
@Test func _link( ) {
You can’t perform that action at this time.
0 commit comments