penibelst/jekyll-compress-html

Don’t clip whitespace from removed end tags

doktorbro opened this issue · 1 comments

This variables are affected:

_endings

  {% assign _edges = " <e;<e; </e>;</e>;</e> ;</e>" | replace: "e", _element | split: ";" %}
  {% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}

Surprisingly the additional check doesn’t boost the performance.

  {% if _endings contains _element %}
    {% assign _edges = " <e;<e" | replace: "e", _element | split: ";" %}
    {% assign _content = _content | replace: _edges[0], _edges[1] %}
  {% else %}
    {% assign _edges = " <e;<e; </e>;</e>;</e> ;</e>" | replace: "e", _element | split: ";" %}
    {% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}
  {% endif %}