fix(techdocs): support dompurify 3.2.6
Element.tagName is uppercased, see https://developer.mozilla.org/fr/docs/Web/API/Element/tagName Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-techdocs': patch
|
||||
---
|
||||
|
||||
Support Techdocs redirect with dompurify 3.2.6+
|
||||
@@ -65,7 +65,7 @@ export const useSanitizerTransformer = (): Transformer => {
|
||||
|
||||
// Only allow http-equiv and content attributes on meta tags. They are required for the redirect feature.
|
||||
DOMPurify.addHook('uponSanitizeAttribute', (currNode, data) => {
|
||||
if (currNode.tagName !== 'meta') {
|
||||
if (currNode.tagName !== 'META') {
|
||||
if (data.attrName === 'http-equiv' || data.attrName === 'content') {
|
||||
currNode.removeAttribute(data.attrName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user