Description
Hello,
first of all: Thanks for your great work!
I have the following issue (bug?):
I have the following controller:
Route::get('shortcode', function(){
return view('test.shortcode')->with("code", '[b class="bold"]Bold text[/b]');
});
Case 1 - As expected
When I use the variable $code in the template like:
{{ $code }}
it works as expected - I only get the raw string as a result:
[b class="bold"]Bold text[/b]
Case 2 - As expected
When I use the variable $code with the compile comand in the template like:
{{ \Shortcode::compile($code) }}
it works as well as expected - I get the (escaped) parsing result:
<strong class="bold">Bold text</strong>
Using it with unescaped blade:
{!! \Shortcode::compile($code) !!}
I get
<strong class="bold">Bold text</strong>
Case 3 - Weird
But when I combine both versions, the result is weird.
{{ $code }}<br>
{{ \Shortcode::compile($code) }}
This is the result:
<strong class=""bold"">Bold text</strong><br>
<strong class="bold">Bold text</strong>
WTF? Why gets the first line ({{ $code }}<br>
) parsed and why is the result wrong ("bold"
)?