Fix ProseMirror failing to parse Markdown images

This commit is contained in:
Matt Baer 2021-03-19 17:02:00 -04:00
parent 636c9b35c0
commit 9aa5fc4420
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ export const writeAsMarkdownParser = new MarkdownParser(
getAttrs: (tok) => ({
src: tok.attrGet("src"),
title: tok.attrGet("title") || null,
alt: tok.children?.[0].content || null,
alt: (tok.children !== null && typeof tok.children[0] !== 'undefined' ? tok.children[0].content : null),
}),
},
hardbreak: { node: "hard_break" },