diff --git a/lib/beacon/template/markdown.ex b/lib/beacon/template/markdown.ex index 4f6641223..b65e0947b 100644 --- a/lib/beacon/template/markdown.ex +++ b/lib/beacon/template/markdown.ex @@ -16,8 +16,7 @@ defmodule Beacon.Template.Markdown do """ @spec convert_to_html(Beacon.Template.t(), Beacon.Template.LoadMetadata.t()) :: {:cont, Beacon.Template.t()} | {:halt, Exception.t()} - def convert_to_html(template, _metadata, opts \\ []) do - syntax_highlight_theme = Keyword.get(opts, :syntax_highlight_theme, "onedark") + def convert_to_html(template, _metadata, _opts \\ []) do template = MDEx.to_html!(template, @@ -40,9 +39,8 @@ defmodule Beacon.Template.Markdown do render: [ unsafe_: true ], - features: [ - syntax_highlight_theme: syntax_highlight_theme - ] + syntax_highlight: [formatter: {:html_inline, theme: "onedark"}], + sanitize: MDEx.Document.default_sanitize_options() ) {:cont, template} diff --git a/mix.exs b/mix.exs index 987cc99a2..0227e194f 100644 --- a/mix.exs +++ b/mix.exs @@ -59,7 +59,7 @@ defmodule Beacon.MixProject do # Overridable override_dep(:phoenix, "~> 1.7", "PHOENIX_VERSION", "PHOENIX_PATH"), override_dep(:phoenix_live_view, ">= 1.0.1", "PHOENIX_LIVE_VIEW_VERSION", "PHOENIX_LIVE_VIEW_PATH"), - override_dep(:mdex, "~> 0.2", "MDEX_VERSION", "MDEX_PATH"), + override_dep(:mdex, "~> 0.9", "MDEX_VERSION", "MDEX_PATH"), # Runtime {:accent, "~> 1.1"},