Bug #21951 Bug Fixed

Conditional parser removes whitespace

Version: 2.11.1 Reporter: GDmac - expocom

This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report

All whitespace in conditionals is completely removed by the conditionals parser in
expressionengine/library/parser/conditional/parser.php
method closeBuffer() does a trim($out) causing all anchor tags to hug together

{exp:low_yearly_archives channel="foobar"}
<div>{year}</div>
  {months}
    {if "{num_entries}" != "0"}
      <a href="http://{path=group/template/{year}/{month_num}}">{month_short}</a>
    {/if}
  {/months}
{/exp:low_yearly_archives}
  • Change conditional parser method closeBuffer() to, instead of trim($out) to return ltrim($out), or return $out, to keep some of your whitespace around. Ideally the parser should return the full tagdata when the condition is met, and nothing when the condition is not met.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases