diff --git a/src/lib/UI/Realm/RealmHubIcon.svelte b/src/lib/UI/Realm/RealmHubIcon.svelte index 980364c7..9b87d4dc 100644 --- a/src/lib/UI/Realm/RealmHubIcon.svelte +++ b/src/lib/UI/Realm/RealmHubIcon.svelte @@ -2,6 +2,7 @@ import { BookIcon, ImageIcon, SmileIcon } from "lucide-svelte"; import { alertNormal } from "src/ts/alert"; import { hubURL, type hubType } from "src/ts/characterCards"; + import { trimNonLatin } from "src/ts/storage/globalApi"; export let onClick = () => {} export let chara:hubType @@ -13,7 +14,7 @@ {chara.name}
{chara.name} - {chara.desc} + {trimNonLatin(chara.desc)}
{#each chara.tags as tag, i} {#if i < 4} diff --git a/src/ts/storage/globalApi.ts b/src/ts/storage/globalApi.ts index f7a082d3..df44cb1a 100644 --- a/src/ts/storage/globalApi.ts +++ b/src/ts/storage/globalApi.ts @@ -1472,4 +1472,10 @@ export function textifyReadableStream(stream:ReadableStream){ export function toggleFullscreen(){ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen() +} + +export function trimNonLatin(data:string){ + return data .replace(/[^\x00-\x7F]/g, "") + .replace(/ +/g, ' ') + .trim() } \ No newline at end of file