feat: improve status detail page title (#485)

This commit is contained in:
Alex 2022-12-21 15:46:36 +08:00 committed by GitHub
parent 2339acaf5e
commit dfd8b8968a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 2 deletions

View file

@ -2,6 +2,7 @@ import type { Emoji } from 'masto'
export const UserLinkRE = /^https?:\/\/([^/]+)\/@([^/]+)$/
export const TagLinkRE = /^https?:\/\/([^/]+)\/tags\/([^/]+)$/
export const HTMLTagRE = /<[^>]+>/g
export function getDataUrlFromArr(arr: Uint8ClampedArray, w: number, h: number) {
if (typeof w === 'undefined' || typeof h === 'undefined')
@ -29,3 +30,7 @@ export function noop() {}
export const useIsMac = () => computed(() =>
useRequestHeaders(['user-agent'])['user-agent']?.includes('Macintosh')
?? navigator?.platform?.includes('Mac') ?? false)
export function removeHTMLTags(str: string) {
return str.replaceAll(HTMLTagRE, '')
}