framework
framework copied to clipboard
[11.x] Switch Js::encode() to return HtmlString
Updating the Js::encode()
helper to return an instance of HtmlString
rather than a raw string.
The primary reason is to support using the normal escaping Blade tags: {{ Js::encode() }}
, rather than {!! Js::encode() !}}
, when using this in Blade. This will then match the behaviour already possible with Js::from()
which returns an instance of Htmlable
and supports {{ Js::from() }}
.
Since this is a breaking change, it will need to go into v11 - hence the master
branch.
There are no downsides to this change, it may just require minor code updates - which should be trivial to identify and perform with a search for Js::encode(
.
Thanks. Paging in @calebporzio to see if this affects Livewire.
@calebporzio took a Quick Look at this one but didn't see anything wrong with it at first sight. So marking this as ready for review again.
Didn't quite get to this before L11 release.
@taylorotwell does that mean this'll need to wait for Laravel 12?
Can we apply this to master
now so it doesn't get forgotten again?
Best to just attempt a PR @valorin