pleroma/priv/scrubbers/breaks_only.ex
Mark Felder baf7fd2142 Introduce a scrubber that filters only everything except breaks
Add more tests for scrub_html_and_truncate/2
2021-06-11 14:35:05 -05:00

16 lines
341 B
Elixir

defmodule Pleroma.HTML.Scrubber.BreaksOnly do
@moduledoc """
An HTML scrubbing policy which limits to linebreaks only.
"""
require FastSanitize.Sanitizer.Meta
alias FastSanitize.Sanitizer.Meta
Meta.strip_comments()
# linebreaks only
Meta.allow_tag_with_these_attributes(:br, [])
Meta.strip_everything_not_covered()
end