From d52ee31c5b8e301fd73ebfd5ce90618a2ed42fa5 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 27 Aug 2025 08:24:13 +0300 Subject: [PATCH] Use the correct key when caching attributed string builder results. --- .../Sources/Other/HTMLParsing/AttributedStringBuilderV1.swift | 2 +- .../Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV1.swift b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV1.swift index 4d194e80b..b6b6dcf92 100644 --- a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV1.swift +++ b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV1.swift @@ -104,7 +104,7 @@ struct AttributedStringBuilderV1: AttributedStringBuilderProtocol { removeDTCoreTextArtifacts(mutableAttributedString) let result = try? AttributedString(mutableAttributedString, including: \.elementX) - Self.cacheValue(result, forKey: htmlString, cacheKey: cacheKey) + Self.cacheValue(result, forKey: originalHTMLString, cacheKey: cacheKey) return result } diff --git a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift index f162e8ce1..71d7d4076 100644 --- a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift +++ b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift @@ -78,7 +78,7 @@ struct AttributedStringBuilderV2: AttributedStringBuilderProtocol { addMatrixEntityPermalinkAttributesTo(mutableAttributedString) let result = try? AttributedString(mutableAttributedString, including: \.elementX) - Self.cacheValue(result, forKey: htmlString, cacheKey: cacheKey) + Self.cacheValue(result, forKey: originalHTMLString, cacheKey: cacheKey) return result }