diff --git a/src/deserialize.ts b/src/deserialize.ts index 56df5d8..1b359b3 100644 --- a/src/deserialize.ts +++ b/src/deserialize.ts @@ -123,7 +123,7 @@ export default function deserialize(node: MdastNode, opts?: OptionType) { type: types.image, children: [{ text: '' }], [imageSourceKey]: node.url, - [imageCaptionKey]: node.alt, + [imageCaptionKey]: [{ text: node.alt }], }; case 'blockquote': return { type: types.block_quote, children }; diff --git a/test/deserialize/__snapshots__/image.test.ts.snap b/test/deserialize/__snapshots__/image.test.ts.snap index 27af2ac..35b66cf 100644 --- a/test/deserialize/__snapshots__/image.test.ts.snap +++ b/test/deserialize/__snapshots__/image.test.ts.snap @@ -2,7 +2,11 @@ exports[`deserialize image 1`] = ` Object { - "caption": "'Jack's profile picture'", + "caption": Array [ + Object { + "text": "'Jack's profile picture'", + }, + ], "children": Array [ Object { "text": "",