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

[5.1] Escape triple bracket echos #9574

Merged
merged 1 commit into from
Jul 10, 2015
Merged

[5.1] Escape triple bracket echos #9574

merged 1 commit into from
Jul 10, 2015

Conversation

eklundchristopher
Copy link

I came across a scenario using vue.js where I needed to return unescaped HTML from a data property (http://vuejs.org/guide/index.html#Mustache_Bindings), and to do so, I need to use the triple bracket syntax ({{{ var }}}), but since Blade also uses that syntax, it was an obvious clash.

Seeing as how the double bracket syntax ({{ $var }}) allows you to escape it by prefixing it with an @ symbol, I thought we might as well allow it for the triple syntax for whenever the need arises. (Unless there is a specific reason for it not being allowed already?)

So, in short, this PR allows for the following syntaxes:
{{{ $var }}} outputs <?php echo e($var); ?>
@{{{ $var }}} outputs {{{ $var }}}

@eklundchristopher eklundchristopher changed the title Escape triple bracket echos [5.1] Escape triple bracket echos Jul 9, 2015
taylorotwell added a commit that referenced this pull request Jul 10, 2015
[5.1] Escape triple bracket echos
@taylorotwell taylorotwell merged commit 4e6ad55 into laravel:5.1 Jul 10, 2015
@plashenkov
Copy link

It looks like this PR does not cut the "@" sign which is used to escape brackets. I.e. @ will go to the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants