mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +01:00
13 lines
294 B
Elixir
13 lines
294 B
Elixir
defmodule PhilomenaWeb.TextRenderer do
|
|
alias PhilomenaWeb.MarkdownRenderer
|
|
|
|
def render_one(item, conn) do
|
|
hd(render_collection([item], conn))
|
|
end
|
|
|
|
def render_collection(items, conn) do
|
|
Enum.map(items, fn item ->
|
|
MarkdownRenderer.render(item.body, conn)
|
|
end)
|
|
end
|
|
end
|