Skip to content

Commit 87eff29

Browse files
committed
Merge branch 'main' of github.com:cure53/DOMPurify
2 parents 809a902 + c0d418c commit 87eff29

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ After sanitizing your markup, you can also have a look at the property `DOMPurif
7373

7474
DOMPurify technically also works server-side with Node.js. Our support strives to follow the [Node.js release cycle](https://nodejs.org/en/about/releases/).
7575

76-
Running DOMPurify on the server requires a DOM to be present, which is probably no surprise. Usually, [jsdom](https://github.com/jsdom/jsdom) is the tool of choice and we **strongly recommend** to use the latest version of _jsdom_.
76+
Running DOMPurify on the server requires a DOM to be present, which is probably no surprise. Usually, [jsdom](https://github.com/jsdom/jsdom) is the tool of choice and we **strongly recommend** to use the latest version of _jsdom_.
7777

7878
Why? Because older versions of _jsdom_ are known to be buggy in ways that result in XSS _even if_ DOMPurify does everything 100% correctly. There are **known attack vectors** in, e.g. _jsdom v19.0.0_ that are fixed in _jsdom v20.0.0_ - and we really recommend to keep _jsdom_ up to date because of that.
7979

@@ -369,11 +369,11 @@ _Example_:
369369
370370
```js
371371
DOMPurify.addHook(
372-
'beforeSanitizeElements',
372+
'uponSanitizeAttribute',
373373
function (currentNode, hookEvent, config) {
374-
// Do something with the current node and return it
375-
// You can also mutate hookEvent (i.e. set hookEvent.forceKeepAttr = true)
376-
return currentNode;
374+
// Do something with the current node
375+
// You can also mutate hookEvent for current node (i.e. set hookEvent.forceKeepAttr = true)
376+
// For other than 'uponSanitizeAttribute' hook types hookEvent equals to null
377377
}
378378
);
379379
```

0 commit comments

Comments
 (0)