diff --git a/README.md b/README.md index 96640b54..008481cd 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,14 @@ Afterwards you can sanitize strings by executing the following code: let clean = DOMPurify.sanitize(dirty); ``` +Or maybe this, if you love working with Angular or alike: + +```js +import * as DOMPurify from 'dompurify' + +let clean = DOMPurify.sanitize('hello there'); +``` + The resulting HTML can be written into a DOM element using `innerHTML` or the DOM using `document.write()`. That is fully up to you. Note that by default, we permit HTML, SVG **and** MathML. If you only need HTML, which might be a very common use-case, you can easily set that up as well: