0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-02 12:52:38 +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', name : 'justifiedParagraphs',
level : 'block', level : 'block',
start(src) { 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 }, // Hint to Marked.js to stop and check for a match
tokenizer(src, tokens) { tokenizer(src, tokens) {
const regex = /^((:- ).*)|((-: ).*)|((:-: ).*)(?:\n|$)/ym; const regex = /^(((:-))|((-:))|((:-:))) .+\n([^\n].*\n)*\n/ygm;
const match = regex.exec(src); const match = regex.exec(src);
if(match?.length) { if(match?.length) {
let whichJustify; let whichJustify;