{% comment %}Input{% endcomment %}{% capture _content %}{{ include.content }}{% endcapture %}{% comment %}Remove end tags{% endcomment %}{% for _element in site.compress_html.endings %}{% capture _end %}</{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% comment %}Remove comments{% endcomment %}{% if site.compress_html.comments.size == 2 %}{% assign _comment_befores = _content | split: site.compress_html.comments.first %}{% for _comment_before in _comment_befores %}{% assign _comment_content = _comment_before | split: site.compress_html.comments.last | first %}{% if _comment_content %}{% capture _comment %}{{ site.compress_html.comments.first }}{{ _comment_content }}{{ site.compress_html.comments.last }}{% endcapture %}{% assign _content = _content | remove: _comment %}{% endif %}{% endfor %}{% endif %}{% comment %}Compress whitespace outside of <pre>{% endcomment %}{% assign _pre_befores = _content | split: "<pre" %}{% assign _content = "" %}{% for _pre_before in _pre_befores %}{% assign _pres = _pre_before | split: "</pre>" %}{% if _pres.size > 0 %}{% if _pres.size == 2 %}{% capture _content %}{{ _content }}<pre{{ _pres.first }}</pre>{% endcapture %}{% endif %}{% capture _content %}{{ _content }}{{ _pres.last | split: " " | join: " " }}{% endcapture %}{% endif %}{% endfor %}{% comment %}Clip whitespace around elements{% endcomment %}{% for _element in site.compress_html.clippings %}{% 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] %}{% endfor %}{% comment %}Output{% endcomment %}{{ _content }}
