many whitespaces now replace to single space

This commit is contained in:
kimpure 2026-05-21 13:57:47 +00:00
parent 8c793863aa
commit b7a79e82ee
No known key found for this signature in database

View file

@ -172,7 +172,7 @@ export function saferKorean(input: string): string {
mod = SIPrefix[mod.toLowerCase() as keyof typeof SIPrefix]; mod = SIPrefix[mod.toLowerCase() as keyof typeof SIPrefix];
return `${num} ${mod}바이트 `; return `${num} ${mod}바이트 `;
}) })
.replace(/([\d\.]+)[ \t\n]*([개살시평명])/g, (_, num: string, postfix: string)=>{ .replace(/([\d\.]+)\s*([개살시평명])/g, (_, num: string, postfix: string)=>{
// 10명 => 열명 // 10명 => 열명
if (num.includes(".")) { if (num.includes(".")) {
return num + postfix; return num + postfix;
@ -229,4 +229,5 @@ export function saferKorean(input: string): string {
SymbolMap[t as keyof typeof SymbolMap] SymbolMap[t as keyof typeof SymbolMap]
)) ))
.replace(/([\?\!]+)/g, (_, content: string) => content[0]) .replace(/([\?\!]+)/g, (_, content: string) => content[0])
.replace(/\s+/g, " ")
} }