Skip to content

Using double quoted parameters for modifiers in Antlers if condition throws error about unexpected double-quote #3610

@ncla

Description

@ncla

Bug Description

Using double quoted parameter for modifiers in Antlers if condition throws error about unexpected double-quote. This goes against what is written in the documentation on this page: https://statamic.dev/modifiers/contains#arrays

It shows the following example there:

{{ if (foods | contains:"vegan bacon strips") }}

How to Reproduce

{{ if (current_uri | contains:"project") }} asdfasdf {{ /if }}

Throws the following error:

Statamic\View\Antlers\SyntaxError
syntax error, unexpected double-quote mark

Extra Detail

I need to use parameter in such way so that I can include special characters e.g. /project/. Parameter like /project works fine, but /project/ does not and produces another, different syntax error most likely due to the parameter ending with a slash.

Environment

Statamic 3.1.10 Solo
Laravel 8.25.0
PHP 7.4.13
octoper/statamic-inline-assets 4.0.3
statamic/ssg 0.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions