-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Fix to improve removal of whitespace between tables #32
Conversation
👍 Can you use |
This comment has been minimized.
This comment has been minimized.
Probably a better solution, but then it has to be moved from the Will look into it tomorrow |
That utility supports both strings and nodes, so it should work I think! |
Ah gotcha. Overlooked that part. Using the utility now and it seems to work! |
This comment has been minimized.
This comment has been minimized.
Thanks, released! |
Initial checklist
Description of changes
#29 added a fix to remove whitespace nodes from tables, since they caused a warning in React (#28). Though the check for strings containing just a newline is too specific, because whitespace nodes can consist of arbitrary combinations of newlines, tabs and spaces.
When using
rehype-parse
andrehype-react
to transform html documents containing tables that have indentation, react still gives a warning for whitespace within a table, because the check fails here.I used a more robust check to filter out nodes containing only whitespace that will work for any combination of whitespace characters.
I also added a test to check for whitespace removal on tables.