From 216d16ddba9fba905b7cb79da883f18df337bab8 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 27 Aug 2025 17:16:49 +0300 Subject: [PATCH] Add link attributes as URL values instead of String ones --- .../Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift index 4f50b7f36..6277b932c 100644 --- a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift +++ b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift @@ -177,8 +177,8 @@ struct AttributedStringBuilderV2: AttributedStringBuilderProtocol { case "a": content = attributedString(from: childElement, preserveFormatting: preserveFormatting, listTag: listTag, listIndex: &childIndex, indentLevel: indentLevel) - if let href = try? childElement.attr("href") { - content.addAttribute(.link, value: href, range: NSRange(location: 0, length: content.length)) + if let href = try? childElement.attr("href"), let url = URL(string: href) { + content.addAttribute(.link, value: url, range: NSRange(location: 0, length: content.length)) } case "span":