Merge branch 'main' into store-construct-list-model

This commit is contained in:
ggurdin 2024-11-08 09:57:52 -05:00 committed by GitHub
commit d4f8400eb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -70,11 +70,16 @@ class OverlayMessageTextState extends State<OverlayMessageText> {
);
}
// Convert the entire message into a list of characters
// Convert the entire message into a list of characters
final Characters messageCharacters =
widget.pangeaMessageEvent.messageDisplayText.characters;
// When building token positions, use grapheme cluster indices
// We use grapheme cluster indices to avoid splitting emojis and other
// complex characters that requires multiple code units.
// For instance, the emoji 🇺🇸 is represented by two code units:
// - \u{1F1FA}
// - \u{1F1F8}
final List<TokenPosition> tokenPositions = [];
int globalIndex = 0;