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(
.