Skip to content

Commit

Permalink
commitlint: apply fix
Browse files Browse the repository at this point in the history
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 nblockchain#148
  • Loading branch information
Mersho committed Jan 30, 2024
1 parent 93f65e6 commit 24234ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commitlint/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 24234ac

Please sign in to comment.