Skip to content

Commit 95c1ae6

Browse files
added missing nonce attribute to script macro
1 parent 419413f commit 95c1ae6

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Sources/HTMLKit/HTMLKit.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ public macro script<T: ExpressibleByStringLiteral>(
810810
fetchpriority: HTMLElementAttribute.Extra.fetchpriority? = nil,
811811
integrity: T? = nil,
812812
nomodule: Bool = false,
813+
nonce: T? = nil,
813814
referrerpolicy: HTMLElementAttribute.Extra.referrerpolicy? = nil,
814815
src: T? = nil,
815816
type: HTMLElementAttribute.Extra.scripttype? = nil,

Tests/HTMLKitTests/ElementTests.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ extension ElementTests {
269269
}
270270

271271
// MARK: ol
272+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol
272273
@Test func ol() {
273274
var string:StaticString = #ol()
274275
#expect(string == "<ol></ol>")
@@ -290,6 +291,7 @@ extension ElementTests {
290291
}
291292

292293
// MARK: option
294+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option
293295
@Test func option() {
294296
var string:StaticString = #option()
295297
#expect(string == "<option></option>")
@@ -301,7 +303,15 @@ extension ElementTests {
301303
#expect(string == "<option value=\"earth\"></option>")
302304
}
303305

306+
// MARK: output
307+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/output
308+
@Test func output() {
309+
let string:StaticString = #output(for: ["whats", "it", "tuya"])
310+
#expect(string == "<output for=\"whats it tuya\"></output>")
311+
}
312+
304313
// MARK: script
314+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
305315
@Test func script() {
306316
var string:StaticString = #script()
307317
#expect(string == "<script></script>")

0 commit comments

Comments
 (0)