Skip to content

Commit 13a73ec

Browse files
authored
Merge pull request #19 from KittyGiraudel/patch-1
2 parents 79421d9 + 8c87dbc commit 13a73ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/convertHTMLtoPortableText.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function convertHTMLtoPortableText (HTMLDoc) {
3737
_sanityAsset: `image@${img.getAttribute("src")}`
3838
},
3939
alt: img.getAttribute("alt"),
40-
caption: caption.textContent
40+
caption: caption ? caption.textContent : ''
4141
});
4242
}
4343
},
@@ -109,4 +109,4 @@ function convertHTMLtoPortableText (HTMLDoc) {
109109
parseHtml: html => new JSDOM(html).window.document
110110
})
111111
}
112-
module.exports = convertHTMLtoPortableText
112+
module.exports = convertHTMLtoPortableText

0 commit comments

Comments
 (0)