Add option to not sanitize indexed data on display

Created on 5 June 2025, 3 days ago

Problem/Motivation

In Select Text Format in Views Field for textual content with values from search index ✨ Select Text Format in Views Field for textual content with values from search index Needs work , options were added to allow displaying indexed data containing some HTML, i.e. only some HTML is filtered out of the indexed data.

But one use-case is to store the rendered result, e.g. an entire rendered view mode, in the index so that it can be shown when rendering in hopes of improving the performance of the search page. (The page no longer needs to build each displayed entity's display, it can just pull the already prepared HTML from the index.) In fact, this is the motivation from the Issue Summary of Select Text Format in Views Field for textual content with values from search index ✨ Select Text Format in Views Field for textual content with values from search index Needs work .

With this use in mind, the rendered data in the search index has already been rendered. It's probably not desirable to additionally filter out some HTML from previously rendered and prepared HTML. One example of a problem is that if the rendered HTML contains an SVG, the SVG is stripped by the additional filtering/sanitization.

Steps to reproduce

  1. Store a rendered view mode in your search index. Make sure the rendered view mode contains an SVG.
  2. Attempt to display the indexed view mode and see that the SVG is stipped.

Proposed resolution

Add an additional option to "Allow all HTML" so that site builders can display their previously prepared and processed HTML without some tags being stripped.

Remaining tasks

✨ Feature request
Status

Active

Version

1.0

Component

General code

Created by

πŸ‡ΊπŸ‡ΈUnited States sonfd Portland, ME

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024