forked from AkkomaGang/akkoma
Format
This commit is contained in:
parent
5debd7b5cc
commit
cdb3dd48ab
1 changed files with 3 additions and 2 deletions
|
@ -415,15 +415,16 @@ def update_profile(%{assigns: %{user: user}} = conn, params) do
|
||||||
if bio = params["description"] do
|
if bio = params["description"] do
|
||||||
mentions = Formatter.parse_mentions(bio)
|
mentions = Formatter.parse_mentions(bio)
|
||||||
tags = Formatter.parse_tags(bio)
|
tags = Formatter.parse_tags(bio)
|
||||||
|
|
||||||
emoji =
|
emoji =
|
||||||
(user.info["source_data"]["tag"] || [])
|
(user.info["source_data"]["tag"] || [])
|
||||||
|> Enum.filter(fn %{"type" => t} -> t == "Emoji" end)
|
|> Enum.filter(fn %{"type" => t} -> t == "Emoji" end)
|
||||||
|> Enum.map(fn %{"icon" => %{"url" => url}, "name" => name} ->
|
|> Enum.map(fn %{"icon" => %{"url" => url}, "name" => name} ->
|
||||||
{String.trim(name, ":"), url}
|
{String.trim(name, ":"), url}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
bio_html = CommonUtils.format_input(bio, mentions, tags)
|
bio_html = CommonUtils.format_input(bio, mentions, tags)
|
||||||
|> Formatter.emojify(emoji)
|
Map.put(params, "bio", bio_html |> Formatter.emojify(emoji))
|
||||||
Map.put(params, "bio", bio_html)
|
|
||||||
else
|
else
|
||||||
params
|
params
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue