Skip to content

Commit efc69a4

Browse files
dropped requirement of encasing innerHTML values in an array
1 parent 204b0e4 commit efc69a4

File tree

4 files changed

+182
-175
lines changed

4 files changed

+182
-175
lines changed

Benchmarks/Benchmarks/SwiftHTMLKit/SwiftHTMLKit.swift

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@ package struct SwiftHTMLKitTests : HTMLGenerator {
1212
package init() {}
1313

1414
package func staticHTML() -> String {
15-
#html([
16-
#head([
17-
#title(["StaticView"])
18-
]),
19-
#body([
20-
#h1(["Swift HTML Benchmarks"])
21-
])
22-
])
15+
#html(
16+
#head(
17+
#title("StaticView")
18+
),
19+
#body(
20+
#h1("Swift HTML Benchmarks")
21+
)
22+
)
2323
}
2424
package func dynamicHTML(_ context: HTMLContext) -> String {
25-
let qualities:String = context.user.qualities.map({ #li(["\($0)"]) }).joined()
26-
return #html([
27-
#body([
28-
#h1(["\(context.heading)"]),
29-
#div(attributes: [.id(context.desc_id)], [
30-
#p(["\(context.string)"])
31-
]),
32-
#h2(["\(context.user.details_heading)"]),
33-
#h3(["\(context.user.qualities_heading)"]),
34-
#ul(attributes: [.id(context.user.qualities_id)], ["\(qualities)"])
35-
])
36-
])
25+
let qualities:String = context.user.qualities.map({ #li("\($0)") }).joined()
26+
return #html(
27+
#body(
28+
#h1("\(context.heading)"),
29+
#div(attributes: [.id(context.desc_id)],
30+
#p("\(context.string)")
31+
),
32+
#h2("\(context.user.details_heading)"),
33+
#h3("\(context.user.qualities_heading)"),
34+
#ul(attributes: [.id(context.user.qualities_id)], "\(qualities)")
35+
)
36+
)
3737
}
3838
}

0 commit comments

Comments
 (0)