Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added disambiguation on using raw in expressions #1333

Merged
merged 1 commit into from
Jul 8, 2014
Merged

Added disambiguation on using raw in expressions #1333

merged 1 commit into from
Jul 8, 2014

Conversation

OwlyCode
Copy link
Contributor

@OwlyCode OwlyCode commented Feb 7, 2014

I recently got in trouble using the raw filter in a ternary, leading to a value being escaped and me not expecting it. The code was :

{{ foo|striptags|length > 250 ? foo|striptags|slice(0, 250) ~ '...' : foo|raw }}

When foo's length was under 250 characters, the result of this expression was escaped. Here is the updated documentation to explain why.

@sstok
Copy link

sstok commented Feb 7, 2014

👍

1 similar comment
@mykiwi
Copy link

mykiwi commented Feb 10, 2014

👍

@hason
Copy link
Contributor

hason commented Jul 8, 2014

Similar to #449, #539, #1174, #1320

@fabpot
Copy link
Contributor

fabpot commented Jul 8, 2014

Thank you @OwlyCode.

@fabpot fabpot merged commit cec2b57 into twigphp:master Jul 8, 2014
fabpot added a commit that referenced this pull request Jul 8, 2014
This PR was merged into the 1.16-dev branch.

Discussion
----------

Added disambiguation on using raw in expressions

I recently got in trouble using the ``raw`` filter in a ternary, leading to a value being escaped and me not expecting it. The code was :

```
{{ foo|striptags|length > 250 ? foo|striptags|slice(0, 250) ~ '...' : foo|raw }}
```

When foo's length was under 250 characters, the result of this expression was escaped. Here is the updated documentation to explain why.

Commits
-------

cec2b57 Added disambiguation on using raw in expressions
@fabpot
Copy link
Contributor

fabpot commented Apr 11, 2019

Will finally be fixed by #2934

fabpot added a commit that referenced this pull request Apr 11, 2019
…(fabpot)

This PR was merged into the 1.x branch.

Discussion
----------

Make escaping on ternary expressions more fine-grained

closes #2146
closes #449
closes #539
closes #1174
closes #1320
closes #1739
closes #1333

Commits
-------

dfa9411 made escaping on ternary expressions more fine-grained
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants