Add importing html and save it to Article
Additionally defines a wizard logic which is partially unused yet.
This commit is contained in:
30
lib/outlook/internal_tree.ex
Normal file
30
lib/outlook/internal_tree.ex
Normal file
@ -0,0 +1,30 @@
|
||||
defmodule Outlook.InternalTree do
|
||||
|
||||
alias Outlook.InternalTree.{Html,Modifiers,Basic}
|
||||
alias Outlook.HtmlPreparations.HtmlPreparation
|
||||
|
||||
def render_html(tree) do
|
||||
tree
|
||||
|> HtmlPreparation.strip_whitespace_textnodes()
|
||||
|> Html.to_html()
|
||||
end
|
||||
|
||||
def render_html_preview(tree) do
|
||||
tree
|
||||
|> partition_text
|
||||
|> Html.to_html_preview("1")
|
||||
end
|
||||
|
||||
require Logger
|
||||
def apply_modifier(tree, modifier, uuids, opts \\ %{}) do
|
||||
# Logger.info modifier
|
||||
Modifiers.traverse_tree(tree, modifier, uuids, opts)
|
||||
end
|
||||
|
||||
def partition_text(tree) do
|
||||
# validate_sibling_collocation(tree)
|
||||
tree
|
||||
|> Basic.set_split_markers()
|
||||
|> Basic.partition_textnodes()
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user