Add Html.render_doc/1
Wraps HtmlDocComponent.render_doc/1 and converts the resulting struct to binary.
This commit is contained in:
@ -74,4 +74,11 @@ defmodule Outlook.InternalTree.Html do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def to_html_preview([], _target_id), do: ""
|
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
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user