ENG-3664: Allow for HTML in manage consent page description in Privacy Center#8226
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
kruulik
approved these changes
May 18, 2026
Contributor
kruulik
left a comment
There was a problem hiding this comment.
Looks good to me! I was curious if we use any 3rd party sanitization utilities but seems like this the only one we have (and it's only used here).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket ENG-3664
Description Of Changes
HTML in the Privacy Center consent page heading and description rendered as escaped text even when
ALLOW_HTML_DESCRIPTIONwas enabled. The setting was wired up for the landing page in #6643 but never applied to the consent page components.This PR extracts the existing
TextOrHtmlhelper fromHomePage.tsxinto a shared component and uses it inConsentHeadingandConsentDescription(both notice-driven and config-driven branches), gated on the same setting and using the same allowlist sanitizer.Code Changes
TextOrHtmlfromHomePage.tsxinto a new sharedcomponents/TextOrHtml.tsx, with an optionalcomponentprop (defaults toText) so callers can render different underlying typography.HomePage.tsxto import the shared component and drop the local definition.ConsentDescription.tsxto render the description anddescription_subtextthroughTextOrHtmlin both notice-driven and config-driven branches, gated onALLOW_HTML_DESCRIPTION.ConsentHeading.tsxto render throughTextOrHtmlwithcomponent={Heading}, gated onALLOW_HTML_DESCRIPTION.consent.cy.tsverifying HTML renders when the flag is on and escapes when off.Before
After
Steps to Confirm
FIDES_PRIVACY_CENTER__ALLOW_HTML_DESCRIPTION=trueandFIDES_PRIVACY_CENTER__IS_OVERLAY_ENABLED=trueon the Privacy Center, then restart it.privacy_centerexperience's English translation and put HTML (e.g.<strong>bold</strong>,<em>italic</em>,<ul><li>item</li></ul>,<a href="...">link</a>) in both the title and description fields. Save./consenton the Privacy Center, forcing a matching location via?geolocation=US-XXfor one of the experience's locations. Confirm the heading and description render the HTML (bold, italic, list, link).FIDES_PRIVACY_CENTER__ALLOW_HTML_DESCRIPTION=falseand reload/consent. Confirm the HTML now renders as literal escaped tags.config.jsondescriptionand load/— confirm the landing page still renders HTML and escapes it when the flag is off.Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works