From 1fd052dea95c7b0c8281421622420e867a73f8f0 Mon Sep 17 00:00:00 2001 From: Ben Elliott <4996462+benelliott@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:10:27 +0100 Subject: [PATCH] Add documentation for `preserveEscapedAttributes` option --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 721c14e..650fb01 100644 --- a/README.md +++ b/README.md @@ -738,6 +738,15 @@ disallowedTagsMode: `recursiveEscape` This will transform `hello

world

` to `<disallowed>hello<p>world</p></disallowed>` +#### Escape the disallowed tag, including all its attributes. + +By default, disallowed attributes are stripped from escaped tags. You can set `preserveEscapedAttributes` to `true` to +keep them as-is. + +```js +preserveEscapedAttributes: true +``` + ### Ignore style attribute contents Instead of discarding faulty style attributes, you can allow them by disabling the parsing of style attributes: