diff --git a/core/core-frontend/src/utils/utils.ts b/core/core-frontend/src/utils/utils.ts index 40b492223e..6bc3821594 100644 --- a/core/core-frontend/src/utils/utils.ts +++ b/core/core-frontend/src/utils/utils.ts @@ -77,7 +77,10 @@ export const setColorName = (obj, keyword: string, key?: string, colorKey?: stri keyword + '' + name.substring(index + keyword.length, name.length) - obj[colorKey] = textCode + obj[colorKey] = DOMPurify.sanitize(textCode, { + ALLOWED_TAGS: ['span'], + ALLOWED_ATTR: ['class'] + }) return } obj[colorKey] = null