Skip to content

Commit 9caf716

Browse files
committed
A target condition
1 parent ed685f6 commit 9caf716

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Sources/SwiftHtml/Html/Tags/A.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,12 @@ public extension A {
100100
node.upsert(Attribute(key: "rel", value: value.rawValue))
101101
return self
102102
}
103-
103+
104104
/// Specifies where to open the linked document
105-
func target(_ value: TargetFrame) -> Self {
106-
node.upsert(Attribute(key: "target", value: value.rawValue))
105+
func target(_ value: TargetFrame, _ condition: Bool = true) -> Self {
106+
if condition {
107+
node.upsert(Attribute(key: "target", value: value.rawValue))
108+
}
107109
return self
108110
}
109111

0 commit comments

Comments
 (0)