fix: comment image rendering

This commit is contained in:
Daniel Kempkens 2023-08-16 16:49:48 +02:00
parent 86675725ff
commit ad0fa15832
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM

View file

@ -8,7 +8,8 @@ defmodule BdfrBrowser.RenderUtils do
end
def message(msg) do
img_replacement = "<img src=\"/chat_media/\\1\" style=\"max-width: 300px;\" alt=\"Image\" />"
img_replacement =
"<p class=\"text-center\"><img src=\"/chat_media/\\1\" class=\"img-fluid\" loading=\"lazy\" /></p>"
msg
|> String.replace(~r/https:\/\/i\.redd\.it\/(.+)/, img_replacement)