From 0288c2ceaedad2a10b7e19b79bdcad48adf82131 Mon Sep 17 00:00:00 2001 From: djytw Date: Sun, 27 Oct 2019 04:02:50 +0100 Subject: [PATCH] fix: match pattern repeated for 2+ times --- src/main/middlewares/TextModifierMiddleware.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/middlewares/TextModifierMiddleware.ts b/src/main/middlewares/TextModifierMiddleware.ts index 639e074..b373fc6 100644 --- a/src/main/middlewares/TextModifierMiddleware.ts +++ b/src/main/middlewares/TextModifierMiddleware.ts @@ -20,7 +20,7 @@ export default class TextInterceptorMiddleware if (context.text === '') return } if (this.deduplicate) { - context.text = context.text.replace(/(\S+)\1/g, '$1') + context.text = context.text.replace(/(\S+?)\1+/g, '$1') if (context.text === '') return }