mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: remove pre tags from DOMPurify config (#68512)
This commit is contained in:
parent
25c55d74f1
commit
4ccaf801d7
@ -33,13 +33,13 @@ const sanitizeTextPanelWhitelist = new xss.FilterXSS({
|
||||
/**
|
||||
* Return a sanitized string that is going to be rendered in the browser to prevent XSS attacks.
|
||||
* Note that sanitized tags will be removed, such as "<script>".
|
||||
* We don't allow form, pre, or input elements.
|
||||
* We don't allow form or input elements.
|
||||
*/
|
||||
export function sanitize(unsanitizedString: string): string {
|
||||
try {
|
||||
return DOMPurify.sanitize(unsanitizedString, {
|
||||
USE_PROFILES: { html: true },
|
||||
FORBID_TAGS: ['form', 'input', 'pre'],
|
||||
FORBID_TAGS: ['form', 'input'],
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('String could not be sanitized', unsanitizedString);
|
||||
|
Loading…
Reference in New Issue
Block a user