Skip to content
Snippets Groups Projects
Commit f74f07df authored by Jorin's avatar Jorin
Browse files

Fix formatting

parent 6d362e79
No related tags found
No related merge requests found
Pipeline #
......@@ -104,28 +104,35 @@ defmodule Pleroma.Formatter do
[]
end)
@emoji_from_file (graceful_text_extract = fn
{:ok, custom} -> custom
{:error, :enoent} -> ""
# Only handles non-existent files nicely!
end
graceful_file_extract = fn (filename) ->
filename |> File.read |> graceful_text_extract.()
end
default = graceful_file_extract.("config/emoji.txt")
custom = graceful_file_extract.("config/custom_emoji.txt")
default <> "\n" <> custom # Add a newline in between in case default doesn't end with \n
|> String.split("\n")
|> Enum.filter(fn (line) -> line != "" end) # Strip newlines
|> Enum.map(fn (line) ->
# Split each line by commas, then remove whitespace around the resulting strings
line
|> String.split(",")
|> Enum.map(fn (str) -> String.strip str end)
end))
@emoji_from_file (
graceful_text_extract = fn
{:ok, custom} ->
custom
{:error, :enoent} ->
""
# Only handles non-existent files nicely!
end
graceful_file_extract = fn filename ->
filename |> File.read() |> graceful_text_extract.()
end
default = graceful_file_extract.("config/emoji.txt")
custom = graceful_file_extract.("config/custom_emoji.txt")
# Add a newline in between in case default doesn't end with \n
(default <> "\n" <> custom)
|> String.split("\n")
# Strip newlines
|> Enum.filter(fn line -> line != "" end)
|> Enum.map(fn line ->
# Split each line by commas, then remove whitespace around the resulting strings
line
|> String.split(",")
|> Enum.map(fn str -> String.strip(str) end)
end)
)
@emoji_from_globs (
static_path = Path.join(:code.priv_dir(:pleroma), "static")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment