From 08b0f47ea25005d80579079b10cc1a8717da39f9 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 17 Dec 2024 21:33:33 -0600 Subject: [PATCH] Fix Regex for Justified paragraphs --- shared/naturalcrit/markdown.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 6c76194cb..7a5c45d99 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -380,11 +380,10 @@ const justifiedParagraphs = { name : 'justifiedParagraphs', level : 'block', start(src) { - return src.match(/\n(?:-:|:-|:-:) {1}/m)?.index; - + return src.match(/\n(?:-:|:-|-:) {1}/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const regex = /^((:- ).*)|((-: ).*)|((:-: ).*)(?:\n|$)/ym; + const regex = /^(((:-))|((-:))|((:-:))) .+\n([^\n].*\n)*\n/ygm; const match = regex.exec(src); if(match?.length) { let whichJustify;