-
Notifications
You must be signed in to change notification settings - Fork 49
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
Selective usage of shortcode not working #34
Comments
your Case 1 works if you add Route::get('/test', function(){
return view('test')->with("code", '[b class="bold"]Bold text[/b]')->withShortcodes();
}); Result: https://prnt.sc/jyi07l |
Thats not the problem, because case 1 is not expected to work, so its ok, that it doesn't work. The problem is the weird behavior of case 3. |
test.blade.php {{$code}}
<br>
{!! \Shortcode::compile($code) !!} web.php Route::get('/test', function(){
return view('test')->with("code", '[b class="bold"]Bold text[/b]');
}); Result: http://prntscr.com/jz3s82 Try using |
I think what @bernhardh wants to say is that he doesn't want the first line ( This is also something we've been facing ourselves. Is there a way to achieve this? |
Hello,
first of all: Thanks for your great work!
I have the following issue (bug?):
I have the following controller:
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.
This is the result:
WTF? Why gets the first line (
{{ $code }}<br>
) parsed and why is the result wrong ("bold"
)?The text was updated successfully, but these errors were encountered: