philomena/lib/philomena_web/text_renderer.ex

14 lines
294 B
Elixir
Raw Normal View History

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