We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 79421d9 + 8c87dbc commit 13a73ecCopy full SHA for 13a73ec
src/convertHTMLtoPortableText.js
@@ -37,7 +37,7 @@ function convertHTMLtoPortableText (HTMLDoc) {
37
_sanityAsset: `image@${img.getAttribute("src")}`
38
},
39
alt: img.getAttribute("alt"),
40
- caption: caption.textContent
+ caption: caption ? caption.textContent : ''
41
});
42
}
43
@@ -109,4 +109,4 @@ function convertHTMLtoPortableText (HTMLDoc) {
109
parseHtml: html => new JSDOM(html).window.document
110
})
111
112
-module.exports = convertHTMLtoPortableText
+module.exports = convertHTMLtoPortableText
0 commit comments