Closed RyanRoberts closed 2 years ago
Hi @RyanRoberts – sorry about that.
Along with support for non-primitives I added HTML encoding to the retconAttr
filter in 2.4.0 – to make it a bit more safe + bring it more in-line with how the native attr
filter behaves. However, this was a breaking change and in hindsight shouldn't have been made in a minor release – so I've just tagged version 2.4.1 which reverts this particular change. Hopefully this release solves your issue!
@mmikkel Cool thanks, the native attr
filter doesn't appear to escape the same html or will that be the case in Craft 4? 🤔
the native attr filter doesn't appear to escape the same html or will that be the case in Craft 4?
@RyanRoberts Nothing's changed with the attr
filter in Craft 4, but it will definitely encode HTML inside attribute values, exactly like Retcon 2.4.0 did it as per your example above. It'll only happen for the tag that the attr
filter actually only operates on, though (which is the first tag it encounters).
Here's the method that the attr
filter uses to actually render the attributes (highlighted the line that would cause the encoding in your case) – it's actually a Yii class.
I'm using Retcon (thanks!) to inject some links and attributes into an SVG country map, the attribute let me display a styled HTML tooltip. Since the 2.4.0 update my raw html used by Alpine.js and Tippy is being escaped which is breaking the script and preventing the tooltips showing.
You can see an example of it here if you scroll down to the map https://dmbins.com/ride-guide/#guide-map (you might need to switch to the map). It works there because I've not pushed the plugin update live yet.
Here's a wee example of the Retcon code
Everything after "tooltip:" gets escaped
I've tried filtering it with
|raw
but that doesn't help. Is there a solution?Thanks