1

I am translating the following string:

<p> {{{ trans('myapp.signup_instructions', [ 'email' => '<strong>'.$invitation->email .'</strong>']) }}}</p>

However on our website we can still see the "<strong>[email protected]</strong>" as text. We were aiming to convert the just the e-mail parameter in the string into bold text

How can I achieve that?

5
  • It looks weird, it should be work.... Can you try this <p> {{{ "<strong>{trans('myapp.signup_instructions', [ 'email' => $invitation->email ])}</strong>" }}}</p> Commented May 14, 2015 at 17:36
  • wouldn't that make the entire paragraph bold? I just need the e-mail to be bold. Commented May 14, 2015 at 17:37
  • Oh, sorry! I got your question now. Ya, my method is a not good idea Commented May 14, 2015 at 17:40
  • 2
    If you're on Laravel 5 you need to use {!! .. !!} instead of {{{ .. }}} Commented May 14, 2015 at 18:01
  • So {!! ... !!} is there for Angular co-existence or does it have a special meaning? Commented May 14, 2015 at 19:22

1 Answer 1

9

In Laravel 5 you should use {!! !!} to output variable without escaping:

{!! trans('myapp.signup_instructions', ['email' => '<strong>'.$invitation->email .'</strong>']) !!} 

Read more: http://laravel.com/docs/master/upgrade#upgrade-5.0 (Blade Tag Changes section)

PS. This is not related to AngularJS

Sign up to request clarification or add additional context in comments.

1 Comment

Please mention XSS security considerations in the answer

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.