projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'sha512-crypt' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
mrf
/
normalize_markup.ex
diff --git
a/lib/pleroma/web/activity_pub/mrf/normalize_markup.ex
b/lib/pleroma/web/activity_pub/mrf/normalize_markup.ex
index 3d13cdb32bd0e790cc337295112142fd42fd5df0..c269d0f892a0f399c7a820c4d2781bc71bc327ae 100644
(file)
--- a/
lib/pleroma/web/activity_pub/mrf/normalize_markup.ex
+++ b/
lib/pleroma/web/activity_pub/mrf/normalize_markup.ex
@@
-3,22
+3,19
@@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.MRF.NormalizeMarkup do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.MRF.NormalizeMarkup do
+ @moduledoc "Scrub configured hypertext markup"
alias Pleroma.HTML
@behaviour Pleroma.Web.ActivityPub.MRF
alias Pleroma.HTML
@behaviour Pleroma.Web.ActivityPub.MRF
- def filter(%{"type" =>
activity_type} = object) when activity_type == "Create"
do
+ def filter(%{"type" =>
"Create", "object" => child_object} = object)
do
scrub_policy = Pleroma.Config.get([:mrf_normalize_markup, :scrub_policy])
scrub_policy = Pleroma.Config.get([:mrf_normalize_markup, :scrub_policy])
- child = object["object"]
-
content =
content =
- child["content"]
+ child
_object
["content"]
|> HTML.filter_tags(scrub_policy)
|> HTML.filter_tags(scrub_policy)
- child = Map.put(child, "content", content)
-
- object = Map.put(object, "object", child)
+ object = put_in(object, ["object", "content"], content)
{:ok, object}
end
{:ok, object}
end