Skip to content

@{{ }} not working as expected #72

@cossssmin

Description

@cossssmin

Noticed two issues with using @{{ }} for ignoring expressions.

Escaping fails inside attributes

This:

<a href="@{{ foo }}">Home</a>

Becomes this:

<a href="@{{ undefined }}">Home</a>

It still tries to evaluate the expression when inside an attribute.

Escaping in content is a bit glitchy

<p>This is some @{{ variable }}, and here is another: @{{ bar }}</p>

Becomes:

<p>This is some {{ variable }}, and here is another: @{{ bar }}</p>

Basically, since the node is returned right when @ is encountered, any subsequent escaped expressions will be returned as-is (including the @ symbol).

So it's actually enough to do:

<p>This is some @{{ variable }}, and here is another: {{ bar }}</p>

... and that will output:

<p>This is some {{ variable }}, and here is another: {{ bar }}</p>

However, this isn't expected behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions