-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
rehype-minify-whitespace: inline element are trimmed #32
rehype-minify-whitespace: inline element are trimmed #32
Conversation
Thanks for working on this! The list you added, is already in |
Not sure how I could have missed that!
The only solution I see to make that better is to check the siblings of the parent. But these are not available in the |
I worked a bit more on it, I have added a lot of test cases (and implemented) which are not supported with current version and corrupt the DOM. |
Thanks! I've also been looking into this, sorry I didn't share that before. The tests are very useful! |
Feel free to copy the tests and write a better / good solution ;) |
Thanks for your help @kptdobe, released! |
Fixes #19
Inline elements like
a
,span
,em
... loses there leading and trailing whitespaces while those might be are important.This PR is certainly requires some love, happy to improve the code and follow the guidelines.
Note that this changes the current behavior (see existing modified tests).