diff --git a/app/components/BlueskyComment.vue b/app/components/BlueskyComment.vue index 12fe336a1f..c9078f0e06 100644 --- a/app/components/BlueskyComment.vue +++ b/app/components/BlueskyComment.vue @@ -38,16 +38,27 @@ function getHostname(uri: string): string { return uri } } + +let segmenter: Intl.Segmenter | null = null +function firstChar(str: string): string { + segmenter ??= new Intl.Segmenter(undefined, { granularity: 'grapheme' }) + return Array.from(segmenter.segment(str))[0]?.segment ?? '' +}