You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before updating to the latest Laravel release, I had a template that inserted some styles through a @section('style', style_func('param')) and worked fine. After I updated this statement behaves oddly and instead of inlining the style where it should, it automatically places the escaped text inside <p></p> tag in the body. The odd thing is if I do:
@section('style')
style_func('param')
@endsection
it works fine...
As I am sending an email with this, the end result is having some content displayed in the email message and the styles are gone (I'm not using the resources/views/vendor/mail/html/themes/default.css file).
The downside to scenario 2 is that in reality the style is given through a function call which does not work in neither case as the function is not processed as PHP even if I "cascade" a @php directive.
Is using the @section short-syntax doing something different on purpose? This should be documented somewhere over here Blade Templates, but I could not find anything regarding this.
I noticed the styles are being also automatically embedded in the code, is this a new behavior for emails/Mailables?
The text was updated successfully, but these errors were encountered:
axelitus
changed the title
[5.4] Blade template @section behaves oddly
[5.4] Blade template @section behaves inconsistently
Jan 30, 2017
Description:
Before updating to the latest Laravel release, I had a template that inserted some styles through a
@section('style', style_func('param'))
and worked fine. After I updated this statement behaves oddly and instead of inlining the style where it should, it automatically places the escaped text inside<p></p>
tag in the body. The odd thing is if I do:it works fine...
As I am sending an email with this, the end result is having some content displayed in the email message and the styles are gone (I'm not using the
resources/views/vendor/mail/html/themes/default.css
file).Steps To Reproduce:
For simplicity I will create a simple example.
And now scenario 1 (odd behavior):
Result:
This is scenario 2 (which works "fine"):
Result:
The downside to scenario 2 is that in reality the style is given through a function call which does not work in neither case as the function is not processed as PHP even if I "cascade" a @php directive.
Is using the @section short-syntax doing something different on purpose? This should be documented somewhere over here Blade Templates, but I could not find anything regarding this.
I noticed the styles are being also automatically embedded in the code, is this a new behavior for emails/Mailables?
The text was updated successfully, but these errors were encountered: