mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-30 02:22:49 +00:00
Solve regression with monster template.
Was not handling "weak" Definition list endings well ( places were it was \n<something> instead of \n\n.
This commit is contained in:
@@ -263,10 +263,11 @@ const definitionLists = {
|
||||
tokenizer(src, tokens) {
|
||||
const regex = /^([^:\n]*?)[\n]?::(.*)(?:\n|$)/ym;
|
||||
let match;
|
||||
const endIndex = src.match(`\n\n`)?.index + 2;
|
||||
let endIndex = 0;
|
||||
const allDefinitions = [];
|
||||
let currentDefinition = {};
|
||||
while (match = regex.exec(src)) {
|
||||
endIndex += match[0].length;
|
||||
if(match[1].trim()?.length) {
|
||||
if(currentDefinition?.dt?.length) {
|
||||
allDefinitions.push(currentDefinition);
|
||||
|
||||
Reference in New Issue
Block a user