dermatthes/text-template

Skipped blocks leave empty lines

Closed this issue · 2 comments

Example:
Given is an Array of Products which are parsed fine, but the skipped parts will lead to blank lines as in the following.
**Onlinebestellung
{for prod in products}
{= prod.sku},{= prod.quantity},{= prod.pifData.basePrice.price},,{= prod.itemName},,
{if prod.pifData.basePrice.price != 0}
{if prod.notice !=""}
{=prod.notice}
{/if}
{/if}
{if prod.pifData.basePrice.price == 0}
{= prod.sku},{= prod.quantity},,,{= prod.itemName},,
{if prod.notice !=""}
{=prod.notice}
{/if}
{/if}
{/for}
<>

Results in the following output:

**Onlinebestellung

AP 129842,1,0.13,,LogiLink Audio Adapter 1x Mini 3,5mm -> 2x Cinch St/Bu,,

AP 152578,1,0.13,,Herlitz Schnellhefter A4 PP f.sort transparenter Vordeckel,,

AP 161145,1,0.13,,Schwaiger F-Stecker 7,0mm Silber,,

<>

EDIT: Sadly most of the blank lines are stripped in the output of the Issue. There are 13 Blank lines between each AP

Might be a general issue about when to issue a newline and when not (if statements issued in the next line).
Please provide a PR.

Added default section {strip_empty_lines}{/stip_empty_lines}