I split this into two commits in case you don't want the second part.
Support HTML titles - for example:
<th>@sortablelink('title', new Illuminate\Support\HtmlString('<em>Title with HTML</em>'))</th>
This is achieved by (1) using e() instead of htmlentities(), and (2) skipping the formatting function so it's not converted to a string.
(Tip: to shorten this to new HtmlString(...), add 'HtmlString' => Illuminate\Support\HtmlString::class to the aliases section in config.app.)
A config option to not apply the formatting function to any custom titles (including regular strings).
Personally I'd be happy for it to never apply formatting to custom titles (I can't see a good use case for doing so), but I made it a config option that defaults to true so it's fully backwards-compatible. (I could remove that if you think it's unnecessary.)
Fixes #127, in the way I suggested in https://github.com/Kyslik/column-sortable/issues/127#issuecomment-546718374.
I split this into two commits in case you don't want the second part.
Support HTML titles - for example:
This is achieved by (1) using
e()
instead ofhtmlentities()
, and (2) skipping the formatting function so it's not converted to a string.(Tip: to shorten this to
new HtmlString(...)
, add'HtmlString' => Illuminate\Support\HtmlString::class
to thealiases
section inconfig.app
.)A config option to not apply the formatting function to any custom titles (including regular strings).
Personally I'd be happy for it to never apply formatting to custom titles (I can't see a good use case for doing so), but I made it a config option that defaults to
true
so it's fully backwards-compatible. (I could remove that if you think it's unnecessary.)Thanks!