Use the correct key when caching attributed string builder results.

This commit is contained in:
Stefan Ceriu
2025-08-27 08:24:13 +03:00
committed by Doug
parent 9796a9d928
commit d52ee31c5b
2 changed files with 2 additions and 2 deletions

View File

@@ -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
}

View File

@@ -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
}