Add Html.render_doc/1

Wraps HtmlDocComponent.render_doc/1 and converts the resulting struct
to binary.
This commit is contained in:
Thelonius Kort
2023-01-19 20:33:22 +01:00
parent 49d77fc032
commit c0fe63588c

View File

@ -74,4 +74,11 @@ defmodule Outlook.InternalTree.Html do
end
def to_html_preview([], _target_id), do: ""
def render_doc(tree) do
OutlookWeb.HtmlDocComponent.render_doc(%{tree: tree})
|> Phoenix.HTML.Safe.to_iodata()
|> IO.iodata_to_binary()
end
end