Skip to content

remove redundant whitespaces where applicable #4

Description

@freddyb

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions