diff options
author | Fong-Wan Chau <fongwan@chaurocks.com> | 2019-03-17 09:46:46 -0400 |
---|---|---|
committer | Fong-Wan Chau <fongwan@chaurocks.com> | 2019-03-17 11:03:19 -0400 |
commit | 4ed2618f6c732ba1009510f5698a5d981a151925 (patch) | |
tree | 56b06a4c41d008de4daed33f6119a66a059d3691 /lib | |
parent | 6d6f48d0795cc12d3c5aca5d90ae51b10086996d (diff) | |
download | pleroma-4ed2618f6c732ba1009510f5698a5d981a151925.tar.gz |
Allow 'rel' attribute on `<a>` link with specific values (for hashtag recognition).
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/html.ex | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/pleroma/html.ex b/lib/pleroma/html.ex index 05253157e..5b152d926 100644 --- a/lib/pleroma/html.ex +++ b/lib/pleroma/html.ex @@ -95,6 +95,13 @@ defmodule Pleroma.HTML.Scrubber.TwitterText do Meta.allow_tag_with_uri_attributes("a", ["href", "data-user", "data-tag"], @valid_schemes) Meta.allow_tag_with_these_attributes("a", ["name", "title", "class"]) + Meta.allow_tag_with_this_attribute_values("a", "rel", [ + "tag", + "nofollow", + "noopener", + "noreferrer" + ]) + # paragraphs and linebreaks Meta.allow_tag_with_these_attributes("br", []) Meta.allow_tag_with_these_attributes("p", []) @@ -137,6 +144,13 @@ defmodule Pleroma.HTML.Scrubber.Default do Meta.allow_tag_with_uri_attributes("a", ["href", "data-user", "data-tag"], @valid_schemes) Meta.allow_tag_with_these_attributes("a", ["name", "title", "class"]) + Meta.allow_tag_with_this_attribute_values("a", "rel", [ + "tag", + "nofollow", + "noopener", + "noreferrer" + ]) + Meta.allow_tag_with_these_attributes("abbr", ["title"]) Meta.allow_tag_with_these_attributes("b", []) |