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

remove redundant whitespaces where applicable #4

Open
freddyb opened this issue Apr 22, 2013 · 2 comments
Open

remove redundant whitespaces where applicable #4

freddyb opened this issue Apr 22, 2013 · 2 comments
Labels

Comments

@freddyb
Copy link
Owner

freddyb commented Apr 22, 2013

html2dom emits code for text nodes that might contain redundant whitespaces, e.g.

var text = document.createTextNode(" \n          TITLE  ");

The problem here is that we do not know the real context. In most cases, we can just replace multiple whitespaces with a single space. But if the node's parent (or any other direct ancestor) is a <pre> tag or a tag with a css white-space attribute that is set to either pre, pre-wrap or pre-line, then we are doing it wrong.

@freddyb
Copy link
Owner Author

freddyb commented Apr 22, 2013

@freddyb
Copy link
Owner Author

freddyb commented Sep 29, 2014

This should be optional, though.

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

No branches or pull requests

1 participant