When doing markdown to HTML, sanitize HTML

Closes #101
Closes #102
This commit is contained in:
Claudio Ortolina
2026-03-07 19:05:37 +00:00
parent 84ffcc720b
commit 52815bde2f
8 changed files with 44 additions and 0 deletions
@@ -466,6 +466,8 @@ defmodule MusicLibraryWeb.RecordSetLive.Index do
"""
end
# sobelow_skip ["XSS.Raw"]
# Markdown.to_html/1 sanitizes HTML via HtmlSanitizeEx
defp render_description(description) do
description
|> Markdown.to_html()
@@ -302,6 +302,8 @@ defmodule MusicLibraryWeb.RecordSetLive.Show do
defp page_title(:edit, record_set), do: gettext("Edit") <> " · " <> record_set.name
defp page_title(:add_record, record_set), do: gettext("Add Record") <> " · " <> record_set.name
# sobelow_skip ["XSS.Raw"]
# Markdown.to_html/1 sanitizes HTML via HtmlSanitizeEx
defp render_description(description) do
description
|> Markdown.to_html()