sanitize_html 1.3.0 sanitize_html: ^1.3.0 copied to clipboard
Function for sanitizing HTML to prevent XSS by restrict elements and attributes to a safe subset of allowed values.
v1.3.0 #
- Only print self-closing tags for
void-elements.
This could cause
<strong />
in HTML documents, which is can be interpreted as an opening tag by HTML5 parsers, causing the HTML structure to break.
v1.2.0 #
- Does not depend on
universal_html
, uses custom HTML rendering for the output. - Allowed classes are kept, even if there are non-allowed classes present on the same element.
v1.1.0 #
- Add options
allowElementId
andallowClassName
to allow specific element ids and class names.
v1.0.0 #
- Initial release.