Skip to content

Bug with case when structure #2

@fpierrat

Description

@fpierrat

Hi,
I've looked for a couple of hours for a problem on my side, before finally being quite sure it's a bug.
After many tests I got on following simplified bug-reproducing-case:

{% assign v = '2' %}
{% assign t1 = 'one' %}
{% assign t2 = 'two' %}
{% assign t3 = 'more' %}

<br>if structure:
{% if v == '1'%}{{t1}}
{% elsif v == '2'%}{{t2}}
{% else %}{{t3}}
{% endif %}

<br>case structure:
{%case v %}
{% when '1' %}{{t1}}
{% when '2' %}{{t2}}
{% else %}{{t3}}
{% endcase %}

The output of this is:

if structure: two
case structure: ,two,

Where there's no reason for the commas before and after the output "two" text in the case syntax.
Thank in advanced for your help if I'm doing smthg wrong... or for a fix ;-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions