-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
Some visible whitespaces in browser are trimmed in the result #206
Comments
Thanks for pointing this out. Your example uses Ideographic Space ( I don't see a need for an option though. Since the goal of html-to-text is to approximate the browser behavior - we just have to make it behave with each whitespace character like a browser does. I have to take a closer look into HTML spec, add extra tests, and work from there. |
I started to look into this issue and realized it will indeed require an option, with the default set true to HTML spec. |
Thanks very much for your reply. |
Vivaldi (as well as any Chromium-based browsers, I suspect) shows the second example with Ideographic Spaces put on extra line. I think this will be handled well ("as in browser" that is) once I'm done with the refactoring. |
I've pushed the update that should cover this, among many other things. |
New version is now live in npm. |
The line above should return the result like '\n 123\n' instead of '\n123\n' since ' ' is a visible white space in browser.
I would suggest that it's better to provide an option to choose what characters should not be trimmed.
The text was updated successfully, but these errors were encountered: