Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Unable to parse seperator <hr /> #14

Closed
wongmunchoong opened this issue Apr 20, 2016 · 4 comments
Closed

Unable to parse seperator <hr /> #14

wongmunchoong opened this issue Apr 20, 2016 · 4 comments

Comments

@wongmunchoong
Copy link

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
Copy link
Owner

Jxck commented Apr 20, 2016

@wongmunchoong could you show me the html ?

@wongmunchoong
Copy link
Author

wongmunchoong commented Apr 21, 2016

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
Copy link
Owner

Jxck commented Apr 21, 2016

thanks, fixed and publish v1.0.1

@Jxck Jxck closed this as completed Apr 21, 2016
@wongmunchoong
Copy link
Author

Wow, that was fast..
Thanks, works like a charm..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants