mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 16:32:40 +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) {
|
tokenizer(src, tokens) {
|
||||||
const regex = /^([^:\n]*?)[\n]?::(.*)(?:\n|$)/ym;
|
const regex = /^([^:\n]*?)[\n]?::(.*)(?:\n|$)/ym;
|
||||||
let match;
|
let match;
|
||||||
const endIndex = src.match(`\n\n`)?.index + 2;
|
let endIndex = 0;
|
||||||
const allDefinitions = [];
|
const allDefinitions = [];
|
||||||
let currentDefinition = {};
|
let currentDefinition = {};
|
||||||
while (match = regex.exec(src)) {
|
while (match = regex.exec(src)) {
|
||||||
|
endIndex += match[0].length;
|
||||||
if(match[1].trim()?.length) {
|
if(match[1].trim()?.length) {
|
||||||
if(currentDefinition?.dt?.length) {
|
if(currentDefinition?.dt?.length) {
|
||||||
allDefinitions.push(currentDefinition);
|
allDefinitions.push(currentDefinition);
|
||||||
|
|||||||
@@ -320,6 +320,30 @@
|
|||||||
padding : 0px;
|
padding : 0px;
|
||||||
margin-bottom : 0.325cm;
|
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
|
//Headers
|
||||||
h2 {
|
h2 {
|
||||||
margin : 0;
|
margin : 0;
|
||||||
@@ -869,6 +893,8 @@
|
|||||||
dl {
|
dl {
|
||||||
line-height : 1.25em;
|
line-height : 1.25em;
|
||||||
& + * { margin-top : 0.17cm; }
|
& + * { margin-top : 0.17cm; }
|
||||||
|
white-space: normal !important;
|
||||||
|
|
||||||
}
|
}
|
||||||
p + dl { margin-top : 0.17cm; }
|
p + dl { margin-top : 0.17cm; }
|
||||||
dt {
|
dt {
|
||||||
|
|||||||
Reference in New Issue
Block a user