From f293a699b66e69da9078b7738b28c8d26e7a21d6 Mon Sep 17 00:00:00 2001 From: Luke Simonetti Date: Fri, 1 Nov 2019 13:00:54 -0400 Subject: [PATCH] Fix error thrown when invalid html for lists --- htmlToElement.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htmlToElement.js b/htmlToElement.js index fc9151d..5bcca40 100644 --- a/htmlToElement.js +++ b/htmlToElement.js @@ -128,7 +128,9 @@ export default function htmlToElement(rawHtml, customOpts = {}, done) { const defaultStyle = opts.textComponentProps ? opts.textComponentProps.style : null; const customStyle = inheritedStyle(parent); - if (parent.name === 'ol') { + if(!parent){ + listItemPrefix = null; + } else if (parent.name === 'ol') { listItemPrefix = ( {`${orderedListCounter++}. `} );