Skip to content

Commit e0af88e

Browse files
committed
fix: change how sanitize from DOMPurify is imported
1 parent dd85986 commit e0af88e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/text-format.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { sanitize } from 'dompurify';
17+
import DOMPurify from 'dompurify';
1818

1919
export async function loadAsciiDoctor() {
2020
let _gvAsciidoctor = window._gvAsciidoctor;
@@ -51,7 +51,7 @@ export function toDom(text, type = 'adoc', small = false) {
5151
// href="[SERVER_BASE]/#a_link" i.e. href="https://apim-master-portal.cloud.gravitee.io/#a_link"
5252
.replace(/href="#/g, `href="${window.location.href}#`);
5353
// Sanitize HTML content to avoid XSS attacks
54-
innerHTML = sanitize(htmlContent);
54+
innerHTML = DOMPurify.sanitize(htmlContent);
5555
} else {
5656
throw new Error(`Library not found for type : '${type}' | ${text}`);
5757
}

0 commit comments

Comments
 (0)