Add trimNonLatin function to trim non-Latin characters from chara.desc

This commit is contained in:
kwaroran
2024-03-15 08:20:14 +09:00
parent 36614e8fef
commit c8434e7704
2 changed files with 8 additions and 1 deletions

View File

@@ -1472,4 +1472,10 @@ export function textifyReadableStream(stream:ReadableStream<Uint8Array>){
export function toggleFullscreen(){
document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen()
}
export function trimNonLatin(data:string){
return data .replace(/[^\x00-\x7F]/g, "")
.replace(/ +/g, ' ')
.trim()
}