-
Notifications
You must be signed in to change notification settings - Fork 686
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PWA-3401::Update DOM Text Interpreted As HTML in PWA Code where ever …
…it is needed
- Loading branch information
Showing
3 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
10 changes: 9 additions & 1 deletion
10
packages/pagebuilder/lib/ContentTypes/Block/configAggregator.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
import DOMPurify from 'dompurify'; | ||
import { getAdvanced } from '../../utils'; | ||
|
||
export default node => { | ||
// Get the raw HTML content from the first child node | ||
const rawHTML = node.childNodes[0] ? node.childNodes[0].innerHTML : ''; | ||
|
||
// Sanitize the raw HTML using DOMPurify | ||
const sanitizedHTML = DOMPurify.sanitize(rawHTML); | ||
|
||
return { | ||
richContent: node.childNodes[0] ? node.childNodes[0].innerHTML : '', | ||
// Return the sanitized HTML content, along with the result from getAdvanced | ||
richContent: sanitizedHTML, | ||
...getAdvanced(node) | ||
}; | ||
}; |
4 changes: 2 additions & 2 deletions
4
packages/peregrine/lib/talons/FormError/__tests__/__snapshots__/useFormError.spec.js.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`returns concatenated error message when allowErrorMessages 1`] = `"GraphQL Error 1, GraphQL Error 2"`; | ||
exports[`returns concatenated error message when allowErrorMessages 1`] = `"formError.responseError"`; | ||
|
||
exports[`returns general error message 1`] = `"formError.errorMessage, Generic Error"`; | ||
exports[`returns general error message 1`] = `"formError.responseError, Generic Error"`; |
This file contains 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