Skip to content

Commit 8dd0784

Browse files
authored
Fix img alt attribute (#3)
Use 'alt' parameter for 'alt' attribute (instead of 'src')
1 parent 32c9b8f commit 8dd0784

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SwiftHtml/Tags/Img.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ open class Img: Tag {
2323
public init(src: String, alt: String) {
2424
let node = Node(type: .empty, name: "img", attributes: [
2525
Attribute(key: "src", value: src),
26-
Attribute(key: "alt", value: src),
26+
Attribute(key: "alt", value: alt),
2727
])
2828
super.init(node)
2929
}

0 commit comments

Comments
 (0)