forked from AkkomaGang/akkoma
html: ensure comments are correctly scrubbed
This commit is contained in:
parent
aaf3fc1575
commit
8613db0e3b
1 changed files with 2 additions and 4 deletions
|
@ -43,8 +43,6 @@ defmodule Pleroma.HTML.Scrubber.TwitterText do
|
||||||
require HtmlSanitizeEx.Scrubber.Meta
|
require HtmlSanitizeEx.Scrubber.Meta
|
||||||
alias HtmlSanitizeEx.Scrubber.Meta
|
alias HtmlSanitizeEx.Scrubber.Meta
|
||||||
|
|
||||||
alias Pleroma.HTML
|
|
||||||
|
|
||||||
Meta.remove_cdata_sections_before_scrub()
|
Meta.remove_cdata_sections_before_scrub()
|
||||||
Meta.strip_comments()
|
Meta.strip_comments()
|
||||||
|
|
||||||
|
@ -83,8 +81,6 @@ defmodule Pleroma.HTML.Scrubber.Default do
|
||||||
require HtmlSanitizeEx.Scrubber.Meta
|
require HtmlSanitizeEx.Scrubber.Meta
|
||||||
alias HtmlSanitizeEx.Scrubber.Meta
|
alias HtmlSanitizeEx.Scrubber.Meta
|
||||||
|
|
||||||
alias Pleroma.HTML
|
|
||||||
|
|
||||||
@markup Application.get_env(:pleroma, :markup)
|
@markup Application.get_env(:pleroma, :markup)
|
||||||
@uri_schemes Application.get_env(:pleroma, :uri_schemes, [])
|
@uri_schemes Application.get_env(:pleroma, :uri_schemes, [])
|
||||||
@valid_schemes Keyword.get(@uri_schemes, :valid_schemes, [])
|
@valid_schemes Keyword.get(@uri_schemes, :valid_schemes, [])
|
||||||
|
@ -181,6 +177,8 @@ def scrub({"img", attributes, children}) do
|
||||||
{"img", attributes, children}
|
{"img", attributes, children}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def scrub({:comment, children}), do: ""
|
||||||
|
|
||||||
def scrub({tag, attributes, children}), do: {tag, attributes, children}
|
def scrub({tag, attributes, children}), do: {tag, attributes, children}
|
||||||
def scrub({tag, children}), do: children
|
def scrub({tag, children}), do: children
|
||||||
def scrub(text), do: text
|
def scrub(text), do: text
|
||||||
|
|
Loading…
Reference in a new issue