1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-28 02:40:22 +00:00
mobilizon/lib/service/metadata.ex
Thomas Citharel 2749989a28
Drop the eex template and directly use the webpack index.html
Partly reverts ff7fd460

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2019-07-04 17:43:18 +02:00

20 lines
465 B
Elixir

defprotocol Mobilizon.Service.Metadata do
@doc """
Build tags
"""
def build_tags(entity)
end
defmodule Mobilizon.Service.MetadataUtils do
@moduledoc """
Tools to convert tags to string
"""
alias Phoenix.HTML
def stringify_tags(tags) do
Enum.reduce(tags, "", &stringify_tag/2)
end
defp stringify_tag(tag, acc) when is_tuple(tag), do: acc <> HTML.safe_to_string(tag)
defp stringify_tag(tag, acc) when is_binary(tag), do: acc <> tag
end