HtmlSanitizeEx (html_sanitize_ex v1.5.0)

View Source

HtmlSanitizeEx can be used to implement custom scrubbers, from scratch or by extending an existing scrubber.

defmodule MyScrubber do
  use HtmlSanitizeEx, extend: :basic_html

  allow_tag_with_any_attributes("p")
end

You can extend :basic_html, :html5, :markdown_html and :strip_tags.

You can also extend any custom scrubber you created:

defmodule FooBarScrubber do
  use HtmlSanitizeEx, extend: MyScrubber

  allow_tag_with_any_attributes("header")
end

Summary

Functions

basic_html(html)

html5(html)

markdown_html(html)

noscrub(html)

strip_tags(html)