From e1ad05eb3a427bf023223e9fa550c50fd61b124e Mon Sep 17 00:00:00 2001 From: David Bolack Date: Mon, 29 Jan 2024 23:42:13 -0600 Subject: [PATCH] Solve regression with monster template. Was not handling "weak" Definition list endings well ( places were it was \n instead of \n\n. --- shared/naturalcrit/markdown.js | 3 ++- themes/V3/5ePHB/style.less | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 46de16960..151d7e958 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -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); diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index ff8bd286c..865cfef5a 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -320,6 +320,30 @@ padding : 0px; margin-bottom : 0.325cm; + dl { + padding: 0px; + } + + dt::before { + display: block; + } + + dt:nth-child(1n+2)::before { + content: ""; + display: block; + } + + dt { + display: inline; + margin-right : 5px; + margin-left : 0em; + padding: 0px; + } + + dd { + display: inline; + } + //Headers h2 { margin : 0; @@ -869,6 +893,8 @@ dl { line-height : 1.25em; & + * { margin-top : 0.17cm; } + white-space: normal !important; + } p + dl { margin-top : 0.17cm; } dt {