From 0391ac550e8740be7fc3a0be80f7b8237157ac50 Mon Sep 17 00:00:00 2001 From: qwreey Date: Sun, 7 Jun 2026 11:40:38 +0000 Subject: [PATCH] feat: now ~ not replaced --- packages/utils/saferKorean.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/utils/saferKorean.ts b/packages/utils/saferKorean.ts index b3ba885..4acc1a2 100644 --- a/packages/utils/saferKorean.ts +++ b/packages/utils/saferKorean.ts @@ -32,6 +32,10 @@ export function processUnsounds(input: string): string { // 혀엉...!.. 흑. 흣! export function processCensor(input: string): string { return input + .replace( + /([\S!?~]+)([!?~]*)/g, + (_, content: string, tailSymbol: string) => content + tailSymbol, + ) .replace( /([흐하해헤혀형][아으앙응앗웅응ㅡ!?.,><~'"/]+)/g, (content: string) => content[0] ?? "", @@ -499,7 +503,7 @@ export function processSymbol(input: string): string { processSymbol.SymbolMapRegExp, (t) => processSymbol.SymbolMap[t as keyof typeof processSymbol.SymbolMap], ) - .replace(/([?!]+)/g, (_, content: string): string => content[0] ?? "") + .replace(/([?!~]+)/g, (_, content: string): string => content[0] ?? "") .replace(/[ \t\f\r]+/g, " "); } export namespace processSymbol { @@ -508,7 +512,7 @@ export namespace processSymbol { $: "달러", "^": "캐럿", "&": "엔드", - "*": "스타", + "*": "별", "#": "샵", "@": "엣", ".": "쩜", @@ -517,7 +521,7 @@ export namespace processSymbol { _: "언더바", "=": "이퀄", "/": "슬래쉬", - "~": "물결표", + // "~": "물결표", "\\": "역슬래쉬", "♡": "하트 ", "|": "",