fix: use rich (emoji) display name only with <ContentRich>
This commit is contained in:
parent
6d2ca0a1b1
commit
e51ca06f97
8 changed files with 13 additions and 9 deletions
|
@ -39,8 +39,12 @@ export function getServerName(account: Account) {
|
|||
return account.url.match(UserLinkRE)?.[1] || currentUser.value?.server || ''
|
||||
}
|
||||
|
||||
export function getDisplayName(account: Account) {
|
||||
return account.displayName || account.username
|
||||
export function getDisplayName(account?: Account, options?: { rich?: boolean }) {
|
||||
const displayName = account?.displayName || account?.username || ''
|
||||
if (options?.rich)
|
||||
return displayName
|
||||
|
||||
return displayName.replace(/:([\w-]+?):/g, '')
|
||||
}
|
||||
|
||||
export function getShortHandle(account: Account) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue