Skip to content

Whitespace collapse needs a "conservative" (HTML strict) option #168

@stevenvachon

Description

@stevenvachon

The current implementation has forced me to add pseudo-elements containing whitespace in situations like this:

<h3>Title</h3>
<ul>
  <li>Item</li>
</ul>

...minifying to:

<h3>Title</h3><ul><li>Item</li></ul>

...which, when I have:

h3, ul, li {
  display: inline;
}

h3::after {
  content: ':';
}

...renders as:

Title:Item

...instead of:

Title: Item

...which is how spec-compliant HTML collapses whitespace. Obviously, my fix is:

h3::after {
  content: ': ';
}

...but this isn't noticed in dev because of #78 and had to be corrected after a deploy.

Regardless, this plugin should optionally use normalize-html-whitespace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions