File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ function getHostname(uri: string): string {
3838 return uri
3939 }
4040}
41+
42+ function firstChar(str : string ): string {
43+ const segmenter = new Intl .Segmenter ({ granularity: ' grapheme' })
44+ return Array .from (segmenter .segment (str ))[0 ]?.segment ?? ' '
45+ }
4146 </script >
4247
4348<template >
@@ -70,7 +75,7 @@ function getHostname(uri: string): string {
7075 depth === 0 ? 'w-10 h-10' : 'w-8 h-8 text-sm',
7176 ]"
7277 >
73- {{ (comment.author.displayName || comment.author.handle).charAt(0 ).toUpperCase() }}
78+ {{ firstChar (comment.author.displayName || comment.author.handle).toUpperCase() }}
7479 </div >
7580 </a >
7681
@@ -98,7 +103,7 @@ function getHostname(uri: string): string {
98103 v-else
99104 class =" w-6 h-6 rounded-full bg-border flex items-center justify-center text-fg-muted text-xs"
100105 >
101- {{ (comment.author.displayName || comment.author.handle).charAt(0 ).toUpperCase() }}
106+ {{ firstChar (comment.author.displayName || comment.author.handle).toUpperCase() }}
102107 </div >
103108 </a >
104109 <a
You can’t perform that action at this time.
0 commit comments