0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-26 03:02:40 +00:00

Merge pull request #3375 from G-Ambatte/fixDefinitionListUndefinedTypeCrash

Fix crash when match is undefined
This commit is contained in:
Trevor Buckner
2024-03-21 21:56:31 -04:00
committed by GitHub

View File

@@ -337,7 +337,7 @@ const definitionListsMultiline = {
const definitions = [];
while (match = regex.exec(src)) {
if(match[1]) {
if(this.lexer.blockTokens(match[1].trim())[0].type !== 'paragraph') // DT must not be another block-level token besides <p>
if(this.lexer.blockTokens(match[1].trim())[0]?.type !== 'paragraph') // DT must not be another block-level token besides <p>
break;
definitions.push({
dt : this.lexer.inlineTokens(match[1].trim()),