Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F5811206
links_only.ex
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
782 B
Referenced Files
None
Subscribers
None
links_only.ex
View Options
# Pleroma: A lightweight social networking server
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma.HTML.Scrubber.LinksOnly
do
@moduledoc
"""
An HTML scrubbing policy which limits to links only.
"""
@valid_schemes
Pleroma.Config
.
get
([
:uri_schemes
,
:valid_schemes
],
[])
require
FastSanitize.Sanitizer.Meta
alias
FastSanitize.Sanitizer.Meta
Meta
.
strip_comments
()
# links
Meta
.
allow_tag_with_uri_attributes
(
:a
,
[
"href"
],
@valid_schemes
)
Meta
.
allow_tag_with_this_attribute_values
(
:a
,
"rel"
,
[
"tag"
,
"nofollow"
,
"noopener"
,
"noreferrer"
,
"me"
,
"ugc"
])
Meta
.
allow_tag_with_these_attributes
(
:a
,
[
"name"
,
"title"
])
Meta
.
strip_everything_not_covered
()
end
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 14, 3:29 AM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
301158
Default Alt Text
links_only.ex (782 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment