HtmlSanitizeEx.Scrubber.HTML5 (html_sanitize_ex v1.5.4)

Copy Markdown View Source

Allows all HTML5 tags to support user input.

This should be used as a template for your own, more tailored scrubber!

Sanitizes all objectively malicious content, but for example, this allows all data-* attributes, but that might not be a good choice, depending on which frontend frameworks your site uses.

Summary

Functions

before_scrub(html)

Callback implementation for HtmlSanitizeEx.Scrubber.before_scrub/1.

sanitize(html)

scrub(text)

Callback implementation for HtmlSanitizeEx.Scrubber.scrub/1.

scrub_attribute(tag, attribute)

Callback implementation for HtmlSanitizeEx.Scrubber.scrub_attribute/2.

scrub_attributes(tag, attributes)

Callback implementation for HtmlSanitizeEx.Scrubber.scrub_attributes/2.