Shopify / liquid

Liquid markup language. Safe, customer facing template language for flexible web apps.

Home Page:https://shopify.github.io/liquid/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conditional format in liquid template adds empty html element rather removing from the template

m-nathani opened this issue · comments

Working on an email template using Liquid to conditionalize some html, however the elements which are conditionally hidden, they are adding the empty row in the template for it like this:

<tr><td><p></p></td></tr>

and there is nothing like this in our template i have attached below:

<table style="border-collapse:collapse" width="100%" cellpadding="4">
  <tbody>
    <tr>
      <th style="text-align:left">Customer:</th>
      <td align="right">{{customer.organization}}</td>
    </tr>
    {% if payment.card_number? %}
    <tr>
      <th style="text-align:left">Card:</th>
      <td align="right">{{payment.card_number}}</td>
    </tr>
    {% endif %}
    <tr>
      <th style="text-align:left">Amount paid:</th>
      <td align="right">{{payment.amount}}</td>
    </tr>
    {% if balance_in_cents > 0 %}
    <tr>
      <th style="text-align:left">Balance owed:</th>
      <td align="right">{{balance}}</td>
    </tr>
    {% endif %}
  </tbody>
</table>

and this is the html i copied from gmail which is generated from the above email template:

<table style="border-collapse:collapse;" width="100%" cellpadding="4">
  <tbody>
    <tr>
      <th align="left">Customer:</th>
      <td align="right">STG SG V32</td>
    </tr>

    <tr>
      <td>
        <p></p>
      </td>
    </tr>
    <tr>
      <th align="left">Amount paid:</th>
      <td align="right">$2,097.00 SGD</td>
    </tr>

    <tr>
      <td>
        <p></p>
      </td>
    </tr>
  </tbody>
</table>

Can anyone help on why its happening or is there something i am missing, as i can't see anything wrong from the things which are in our control.

Tasks

No tasks being tracked yet.