From a306f4aa8d5e3ce451b93880e8f2802e2e1b2bb2 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO <> Date: Mon, 15 Apr 2024 13:14:19 +1000 Subject: [PATCH] fix an issue where the html tag is at the beginning of the localised string --- SessionUtilitiesKit/General/Localization.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SessionUtilitiesKit/General/Localization.swift b/SessionUtilitiesKit/General/Localization.swift index dccec2215..d91a9fd4a 100644 --- a/SessionUtilitiesKit/General/Localization.swift +++ b/SessionUtilitiesKit/General/Localization.swift @@ -84,7 +84,7 @@ public extension NSAttributedString { let currentMatchEnd: Int = currentMatch.range.upperBound /// Ignore invalid ranges - guard currentMatchStart > lastMatchEnd else { return } + guard (currentMatchStart > lastMatchEnd) || (currentMatchStart == lastMatchEnd && currentMatchStart == 0) else { return } /// Retrieve the tag and content values, store the content and any tags which are currently applied so we can construct the /// formatted string at the end