0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-30 02:22:49 +00:00

Fix crash when match is undefined

This commit is contained in:
G.Ambatte
2024-03-22 14:27:45 +13:00
parent 920c4cd7cb
commit bae56b8b9d

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()),