Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitespace text nodes cannot appear as a child of <table> #155

Closed
brainstorm1313 opened this issue May 25, 2020 · 3 comments · Fixed by #162
Closed

Whitespace text nodes cannot appear as a child of <table> #155

brainstorm1313 opened this issue May 25, 2020 · 3 comments · Fixed by #162
Labels
feature New feature or request

Comments

@brainstorm1313
Copy link

brainstorm1313 commented May 25, 2020

I expect correct parse:
parse('<table>\n<tbody><tr><td>sdfq</td></tr></tbody></table>')

It works, but Chrome console has error:
Warning: validateDOMNesting(...): Whitespace text nodes cannot appear as a child of

. Make sure you don't have any extra whitespace between tags on each line of your source code.

https://jsfiddle.net/2f7tpmx5/1/

@remarkablemark
Copy link
Owner

This is similar to aknuds1/html-to-react#79

Long story short, this parser (like html-to-react) creates whitespace text nodes given the input HTML.

The HTML to DOM parser that we use is html-dom-parser.

Fortunately, this is a warning and not an error. However, it might be worth looking into stripping out the whitespace nodes for this library.

@remarkablemark remarkablemark added the feature New feature or request label Jun 6, 2020
@remarkablemark
Copy link
Owner

Please review #162

@remarkablemark
Copy link
Owner

Published 0.13.0:

npm:

npm install [email protected]

yarn:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants