From 70db62ff5a3ab317156d6522a36cb71c88605d58 Mon Sep 17 00:00:00 2001 From: codingChewie Date: Tue, 26 May 2026 21:57:29 -0500 Subject: [PATCH] resolve security regex issue --- src/misc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc.ts b/src/misc.ts index 6450177..da886a4 100644 --- a/src/misc.ts +++ b/src/misc.ts @@ -177,7 +177,7 @@ export const applyRules = (data: string, rules: ApplyRule[]): string => { /** Removes trailing whitespace before the closing tag of block-level elements (`h1`–`h6`, `li`, `td`, `th`). */ export const trimElementWhitespace = (str: string): string => - str.replaceAll(/\s+(<\/(?:h[1-6]|li|td|th)>)/g, '$1') + str.replaceAll(/\s+(?=<\/(?:h[1-6]|li|td|th)>)/g, '') /** * Walks `tagRe` forward from `start`, tracking open/close depth, and returns the index