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

Revert previous simplification as it breaks the original purpose of this PR

Added test for inside a code block.
This commit is contained in:
David Bolack
2024-08-20 12:17:51 -05:00
parent 3985afade9
commit e957f40775
2 changed files with 13 additions and 5 deletions

View File

@@ -395,7 +395,9 @@ const definitionListsSingleLine = {
.map((emoji)=>firstLine = firstLine.replace(emoji.raw, 'x'.repeat(emoji.raw.length)));
const newMatch = /^([^\n]*?)::([^\n]*)(?:\n|$)/ym.exec(firstLine);
if(newMatch) {
if((newMatch) && ((newMatch[2].length > 0) && newMatch[2][0] != ':')) {
// Test the length to handle two : paragraph breaks exception
// Test the first position on the dictionary term to handle three + paragraph breaks exception
definitions.push({
dt : this.lexer.inlineTokens(originalLine.slice(0, newMatch[1].length).trim()),
dd : this.lexer.inlineTokens(originalLine.slice(newMatch[1].length + 2).trim())
@@ -856,8 +858,7 @@ module.exports = {
varsQueue = []; //Could move into MarkedVariables()
globalPageNumber = pageNumber;
rawBrewText = rawBrewText.replace(/^\\column$/gm, `\n<div class='columnSplit'></div>\n`)
.replace(/^(:+)$/gm, (match)=>`${`:\n\n`.repeat(match.length)}\n`);
rawBrewText = rawBrewText.replace(/^\\column$/gm, `\n<div class='columnSplit'></div>\n`);
const opts = Marked.defaults;
rawBrewText = opts.hooks.preprocess(rawBrewText);