framework icon indicating copy to clipboard operation
framework copied to clipboard

[11.x] Switch Js::encode() to return HtmlString

Open valorin opened this issue 5 months ago • 1 comments

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

valorin avatar Jan 10 '24 20:01 valorin