Fix ProseMirror failing to parse Markdown images
This commit is contained in:
parent
636c9b35c0
commit
9aa5fc4420
|
@ -31,7 +31,7 @@ export const writeAsMarkdownParser = new MarkdownParser(
|
||||||
getAttrs: (tok) => ({
|
getAttrs: (tok) => ({
|
||||||
src: tok.attrGet("src"),
|
src: tok.attrGet("src"),
|
||||||
title: tok.attrGet("title") || null,
|
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" },
|
hardbreak: { node: "hard_break" },
|
||||||
|
|
Loading…
Reference in New Issue