fix subsections in outline

This commit is contained in:
inhji 2023-07-13 09:52:12 +02:00
parent 9381ed7bed
commit b1290fba69

View file

@ -11,6 +11,7 @@ defmodule ChiyaWeb.PageHTML do
note.content note.content
|> ChiyaWeb.Outline.get() |> ChiyaWeb.Outline.get()
|> Enum.map(&do_render_outline/1) |> Enum.map(&do_render_outline/1)
|> Enum.map(&safe_to_string/1)
end end
def do_render_outline(%{text: text, children: children, level: _level}) do def do_render_outline(%{text: text, children: children, level: _level}) do
@ -21,6 +22,6 @@ defmodule ChiyaWeb.PageHTML do
content_tag(:a, text, href: "##{slug}")), content_tag(:a, text, href: "##{slug}")),
Enum.map(children, &do_render_outline/1) Enum.map(children, &do_render_outline/1)
] ]
) |> safe_to_string() )
end end
end end