Merge pull request #74 from jnvsor/fixpre

Blanklines: Revert pre changes, add testcases, fix #70
pull/75/head
Jonathan Vollebregt 7 years ago
commit ded78f8bfc
  1. 8
      src/compress.liquid
  2. 4
      test/expected/blanklines/blanklines.html
  3. 3
      test/expected/blanklines/prepre.html
  4. 3
      test/source/blanklines/blanklines.html
  5. 12
      test/source/blanklines/prepre.html

@ -85,17 +85,9 @@
{% if _pres.size != 0 %}
{% if site.compress_html.blanklines %}
{% assign _lines = _pres.last | split: _LINE_FEED %}
{% assign _lastchar = _pres.last | split: "" | last %}
{% assign _outerloop = forloop %}
{% capture _pres_after %}
{% for _line in _lines %}
{% assign _trimmed = _line | split: " " | join: " " %}
{% if forloop.last and _lastchar == _LINE_FEED %}
{% unless _outerloop.last %}
{{ _LINE_FEED }}
{% endunless %}
{% continue %}
{% endif %}
{% if _trimmed != empty or forloop.last %}
{% unless forloop.first %}
{{ _LINE_FEED }}

@ -29,9 +29,11 @@
</pre><pre>
</pre>
<pre>
<span>Text</span>
<pre>
</pre>
</body>
</html>

@ -0,0 +1,3 @@
<div>
TEXT<pre></pre><pre></pre>
</div>

@ -38,6 +38,9 @@ layout: compress
</pre>
<span>Text</span>

@ -0,0 +1,12 @@
---
layout: compress
---
<div>
TEXT
<pre></pre>
<pre></pre>
</div>
Loading…
Cancel
Save