From 358f88e10a7d3de0481309287b4b756087490dfc Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Mon, 10 Sep 2018 00:23:23 +0000 Subject: html: allow inline images by default (because of custom emoji) --- lib/pleroma/html.ex | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib') diff --git a/lib/pleroma/html.ex b/lib/pleroma/html.ex index 1c62f2ccc..107784e70 100644 --- a/lib/pleroma/html.ex +++ b/lib/pleroma/html.ex @@ -37,6 +37,21 @@ defmodule Pleroma.HTML.Scrubber.TwitterText do # microformats Meta.allow_tag_with_these_attributes("span", []) + + # allow inline images for custom emoji + @markup Application.get_env(:pleroma, :markup) + @allow_inline_images Keyword.get(@markup, :allow_inline_images) + + if @allow_inline_images do + Meta.allow_tag_with_uri_attributes("img", ["src"], @valid_schemes) + + Meta.allow_tag_with_these_attributes("img", [ + "width", + "height", + "title", + "alt" + ]) + end end defmodule Pleroma.HTML.Scrubber.Default do -- cgit v1.2.3