Fix new credo warnings

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-11-26 14:30:46 +01:00
parent 52e624bb88
commit 51afec1856
20 changed files with 77 additions and 72 deletions

View File

@@ -21,7 +21,7 @@ defmodule Mobilizon.GraphQL.API.Utils do
text
|> Formatter.html_escape("text/plain")
|> Formatter.linkify(options)
|> (fn {text, mentions, tags} -> {String.replace(text, ~r/\r?\n/, "<br>"), mentions, tags} end).()
|> inject_new_lines()
end
def format_input(text, "text/html", options) do
@@ -30,6 +30,10 @@ defmodule Mobilizon.GraphQL.API.Utils do
|> Formatter.linkify(options)
end
defp inject_new_lines({text, mentions, tags}) do
{String.replace(text, ~r/\r?\n/, "<br>"), mentions, tags}
end
@doc """
Use the data-media-id attributes to extract media from body text
"""