feat: now ~ not replaced

This commit is contained in:
qwreey 2026-06-07 11:40:38 +00:00
parent 50c4b37626
commit 0391ac550e
No known key found for this signature in database

View file

@ -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 {
_: "언더바",
"=": "이퀄",
"/": "슬래쉬",
"~": "물결표",
// "~": "물결표",
"\\": "역슬래쉬",
"♡": "하트 ",
"|": "",