From eb46b367a0b06f5d3883c604af3b28b889458876 Mon Sep 17 00:00:00 2001 From: jourdiw Date: Thu, 3 Apr 2025 17:28:30 +0200 Subject: [PATCH] refactor: change how sanitize from DOMPurify is imported --- src/lib/text-format.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/text-format.js b/src/lib/text-format.js index 03e0c567..b37a2ebf 100644 --- a/src/lib/text-format.js +++ b/src/lib/text-format.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import { sanitize } from 'dompurify'; +import DOMPurify from 'dompurify'; export async function loadAsciiDoctor() { let _gvAsciidoctor = window._gvAsciidoctor; @@ -51,7 +51,7 @@ export function toDom(text, type = 'adoc', small = false) { // href="[SERVER_BASE]/#a_link" i.e. href="https://apim-master-portal.cloud.gravitee.io/#a_link" .replace(/href="#/g, `href="${window.location.href}#`); // Sanitize HTML content to avoid XSS attacks - innerHTML = sanitize(htmlContent); + innerHTML = DOMPurify.sanitize(htmlContent); } else { throw new Error(`Library not found for type : '${type}' | ${text}`); }