Skip to content

Commit

Permalink
fix: added handling for missing href field
Browse files Browse the repository at this point in the history
  • Loading branch information
Vikram Kalta authored and Vikram Kalta committed Nov 9, 2023
1 parent 38b62ce commit 182248f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/ContentstackUtils/Option.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ open class Option: Renderable {
case NodeType.paragraph.rawValue:
return "<p>\(next(node.children))</p>"
case NodeType.link.rawValue:
return "<a href=\"\(node.attrs["href"] ?? "")\">\(next(node.children))</a>"
return "<a href=\"\(node.attrs["href"] ?? node.attrs["url"] ?? "")\">\(next(node.children))</a>"
case NodeType.image.rawValue:
return "<img src=\"\(node.attrs["src"] ?? node.attrs["asset-link"] ?? "")\" />\(next(node.children))"
case NodeType.embed.rawValue:
Expand Down

0 comments on commit 182248f

Please sign in to comment.