From c5897f78aedcfb6e71ec69544aa45bc250bebdc8 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 17 May 2021 14:06:55 -0500 Subject: [PATCH] Change to test all characters for multiple scalars. Fixes #3120 --- .../FeedProvider/Twitter/TwitterStatus.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Account/Sources/Account/FeedProvider/Twitter/TwitterStatus.swift b/Account/Sources/Account/FeedProvider/Twitter/TwitterStatus.swift index 59f3dfc58..149814667 100644 --- a/Account/Sources/Account/FeedProvider/Twitter/TwitterStatus.swift +++ b/Account/Sources/Account/FeedProvider/Twitter/TwitterStatus.swift @@ -78,21 +78,21 @@ private extension TwitterStatus { var html = String() var prevIndex = displayStartIndex - var emojiOffset = 0 + var unicodeScalarOffset = 0 for entity in entities { - // The twitter indices are messed up by emoji with more than one scalar, we are going to adjust for that here. - let emojiEndIndex = text.index(text.startIndex, offsetBy: entity.endIndex, limitedBy: text.endIndex) ?? text.endIndex - if prevIndex < emojiEndIndex { - let emojis = String(text[prevIndex..