fix: Add missing file

This commit is contained in:
Daniel Kempkens 2023-08-15 13:09:32 +02:00
parent f5c0ed776e
commit aa761d4112
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM

View file

@ -0,0 +1,9 @@
defmodule BdfrBrowser.RenderUtils do
def message(msg) do
img_replacement = "<img src=\"/chat_media/\\1\" style=\"max-width: 500px;\" alt=\"Image\" />"
msg
|> String.replace(~r/https:\/\/i\.redd\.it\/(.+)/, img_replacement)
|> Earmark.as_html!()
end
end