Skip to content

Commit 419413f

Browse files
added 9 missing attributes for object macro
1 parent fc0119c commit 419413f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Sources/HTMLKit/HTMLKit.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,10 +663,19 @@ public macro noscript<T: ExpressibleByStringLiteral>(
663663
public macro object<T: ExpressibleByStringLiteral>(
664664
attributes: [HTMLElementAttribute] = [],
665665

666+
archive: [T] = [],
667+
border: Int? = nil,
668+
classid: T? = nil,
669+
codebase: T? = nil,
670+
codetype: T? = nil,
671+
data: T? = nil,
672+
declare: Bool = false,
666673
form: T? = nil,
667674
height: HTMLElementAttribute.CSSUnit? = nil,
668675
name: T? = nil,
676+
standby: T? = nil,
669677
type: T? = nil,
678+
usemap: T? = nil,
670679
width: HTMLElementAttribute.CSSUnit? = nil,
671680
_ innerHTML: T...
672681
) -> T = #externalMacro(module: "HTMLKitMacros", type: "HTMLElement")

Tests/HTMLKitTests/ElementTests.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,13 @@ extension ElementTests {
261261
#expect(string == "<meta charset=\"utf-8\" http-equiv=\"content-type\">")
262262
}
263263

264+
// MARK: object
265+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object
266+
@Test func object() {
267+
let string:StaticString = #object(archive: ["https://github.com/RandomHashTags/destiny", "https://youtube.com"], border: 5)
268+
#expect(string == "<object archive=\"https://github.com/RandomHashTags/destiny https://youtube.com\" border=\"5\"></object>")
269+
}
270+
264271
// MARK: ol
265272
@Test func ol() {
266273
var string:StaticString = #ol()

0 commit comments

Comments
 (0)