0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +00:00

Fix Regex for Justified paragraphs

This commit is contained in:
David Bolack
2024-12-17 21:33:33 -06:00
parent f9b42a30f7
commit 08b0f47ea2

View File

@@ -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;