HtmlSanitizeEx.Scrubber.HTML5 (html_sanitize_ex v1.5.5)

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, which might be an unsafe 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_attribute(binary, arg, arg3)