fix: make processCensor more simple

This commit is contained in:
kimpure 2026-06-06 14:45:52 +00:00
parent aa8aa9ada2
commit d71043b92b
No known key found for this signature in database

View file

@ -19,11 +19,11 @@ export function processUnsounds(input: string): string {
export function processCensor(input: string): string {
return input
.replace(
/(흐[아으앙응앗웅응ㅡ]+[!?.,><]*)|(하[아으앙응앗웅응ㅡ]+[!?.,><]*)/g,
/([흐하해헤][아으앙응앗웅응ㅡ!?.,><]+)/g,
(content: string) => content[0] ?? "",
)
.replace(
/[아ㅏ어ㅓ으ㅡ우ㅜ에오ㅗ야ㅑ앙읏웃앗엣웅응흐헤헼헥하あアうおーaAoOuU][아ㅏ어ㅓ으ㅡ우ㅜ에오ㅗ야ㅑ앙읏웃앗엣웅응흐헤헼헥하あアうおーaAoOuU!.,><]{2,}/g,
/[아ㅏ어ㅓ으ㅡ우ㅜ에오ㅗ야ㅑ앙읏웃앗엣웅응흐헤헼헥하あアうおーaAoOuU][아ㅏ어ㅓ으ㅡ우ㅜ에오ㅗ야ㅑ앙읏웃앗엣웅응흐헤헼헥하あアうおーaAoOuU!.,><]{2,}/g,
(content: string) => content.substring(0, 3),
);
}