Unable to parse seperator <hr />
wongmunchoong opened this issue · comments
Alexander Wong commented
I used the html2json to parse my tinymce content to json format. so far all working until i put in
<hr />
i got this error
Uncaught (in promise) TypeError: Cannot read property 'child' of undefined
at Object.HTMLParser.start (http://localhost:3000/html2json.js:69:21)
at parseStartTag (https://cdn.rawgit.com/blowsie/Pure-JavaScript-HTML5-Parser/master/htmlparser.js:217:14)
at String.replace (native)
at HTMLParser.HTMLParser (https://cdn.rawgit.com/blowsie/Pure-JavaScript-HTML5-Parser/master/htmlparser.js:147:16)
at html2json (http://localhost:3000/html2json.js:27:5)
at http://localhost:3000/init.js:43:17
at http://localhost:3000/js/tinymce/tinymce.min.js:10:19381
at http://localhost:3000/js/tinymce/tinymce.min.js:10:18445
what my init,js do is just getContent from tinymce and just call html2json.
is this a known issue?
Thanks
Jxck commented
@wongmunchoong could you show me the html ?
Alexander Wong commented
You mean the value i pass into the html2json?
just
<hr />
or if my js code,
var rawContent = tinymce.activeEditor.getContent({format : 'raw'});
var json = html2json(rawContent );
console.log(json);
document.getElementById("test1").innerText = JSON.stringify(json, null, 4);
the rawContent contain <hr />
Jxck commented
thanks, fixed and publish v1.0.1
Alexander Wong commented
Wow, that was fast..
Thanks, works like a charm..