diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 939c2cc81..a99c1e543 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -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
+ if(this.lexer.blockTokens(match[1].trim())[0]?.type !== 'paragraph') // DT must not be another block-level token besides
break; definitions.push({ dt : this.lexer.inlineTokens(match[1].trim()), diff --git a/tests/markdown/definition-lists.test.js b/tests/markdown/definition-lists.test.js index 87ff6f617..9f5025d73 100644 --- a/tests/markdown/definition-lists.test.js +++ b/tests/markdown/definition-lists.test.js @@ -82,4 +82,10 @@ describe('Multiline Definition Lists', ()=>{ const rendered = Markdown.render(source).trim(); expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('