Open
Description
Description
ATM, the sanitizer can do only 3 things:
enum HtmlSanitizerAction: string
{
/**
* Dropped elements are elements the sanitizer should remove from the input, including their children.
*/
case Drop = 'drop';
/**
* Blocked elements are elements the sanitizer should remove from the input, but retain their children.
*/
case Block = 'block';
/**
* Allowed elements are elements the sanitizer should retain from the input.
*/
case Allow = 'allow';
}
I propose to add another mode: escape that would escape a node.
This is the second time where I need this feature, so maybe it's time to open an RFC.
My use case if the following:
It's exactly how github markdown works.
We can use raw HTML with few HTML tag, like <b>
: exemple
But some other are escaped, like <script>
: <script>console.log('a')</script>