From 8cb4b749f69b05e8151792c5ccd60d5219242460 Mon Sep 17 00:00:00 2001 From: Mehrshad Date: Mon, 22 Jan 2024 12:07:27 +0330 Subject: [PATCH] commitlint: apply fix This commit rectifies a problem in the removeAllCodeBlocks function that was unintentionally deleting all text between two code blocks. The modification guarantees that only the code blocks are substituted, leaving the remaining text unaffected. Fixes https://github.com/nblockchain/conventions/issues/148 --- commitlint/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commitlint/helpers.ts b/commitlint/helpers.ts index f6d886b6..3134e621 100644 --- a/commitlint/helpers.ts +++ b/commitlint/helpers.ts @@ -221,7 +221,7 @@ export abstract class Helpers { } public static removeAllCodeBlocks(text: string) { - return text.replace(/```[^]*```/g, ""); + return text.replace(/```[\s\S]*?```/g, ""); } public static splitByEOLs(text: string, numberOfEols: number) {