From d403d567ba8323bdce3baf0b3b836d7ee2339846 Mon Sep 17 00:00:00 2001 From: xanhacks Date: Mon, 1 Apr 2024 20:33:02 +0200 Subject: [PATCH] add dompurify --- content/docs/framework/dompurify.md | 73 +++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 content/docs/framework/dompurify.md diff --git a/content/docs/framework/dompurify.md b/content/docs/framework/dompurify.md new file mode 100644 index 0000000..a1f04db --- /dev/null +++ b/content/docs/framework/dompurify.md @@ -0,0 +1,73 @@ +--- +title: "DOMPurify" +description: "Cheatsheet on DOMPurify" +lead: "Cheatsheet on DOMPurify" +date: 2023-01-01T00:00:00+00:00 +lastmod: 2023-01-01T00:00:00+00:00 +draft: false +images: [] +menu: + docs: + parent: "framework" +weight: 620 +toc: true +--- + +## DOMPurify + +[DOMPurify](https://github.com/cure53/DOMPurify) is the leading client-side XSS sanitizer for HTML, MathML and SVG. + +Examples of sanitization: + +```js +DOMPurify.sanitize(''); // becomes +DOMPurify.sanitize(''); // becomes +DOMPurify.sanitize('

abc