-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pwa 3401::https://jira.corp.adobe.com/browse/PWA-3401 (#4374)
* Update htmlStringImgUrlConverter.js * Update dependencies package.json * some fix * PWA-3401::Update DOM Text Interpreted As HTML in PWA Code where ever it is needed --------- Co-authored-by: Shivam7-1 <[email protected]>
- Loading branch information
Showing
5 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
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
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) | ||
}; | ||
}; |
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
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
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