Extend the list of allowed html tags for result rewrite

Created on 3 June 2022, over 2 years ago
Updated 20 April 2024, 7 months ago

Problem/Motivation

I tried to rewrite a field's output in a view's field display mode. I'm tied to the display mode "fields" because I use https://www.drupal.org/project/search_api_solr β†’ and here I can't use the content display mode for the view.

Anyway I need to have control over the markup generated for a certain field. So I used the "rewrite result" feature and included my twig template there using "include()".

The one thing not working is that Drupal/Component/Utility/Xss is stripping out my responsive images (picture html tag). The allowed tags are defined in this class and I don't want to add a patch extending these tags since that's dirty coding.

So is there any way to extend the list of allowed tags for the filterAdmin() function in the Xss class? Or would that be a new feature?

Steps to reproduce

1. Create a view.
2. Assign field output mode.
3. Create a field and rewrite the result.
4. Place a picture tag in there (or any other non-allowed tag).
5. The tag is stripped out (as designed in the core, currently).

Proposed resolution

Add a hook to extend the list of allowed tags.

Any help is highly appreciated!

Bye Defcon0

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated about 13 hours ago

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024