From 75eca82a1931685947968b5aa7dc26cd43368f60 Mon Sep 17 00:00:00 2001 From: Dimitar Ivanov Date: Fri, 12 Dec 2025 13:02:34 +0200 Subject: [PATCH] Adjust according to breaking changes in MDEx 0.9 --- lib/beacon/template/markdown.ex | 8 +++----- mix.exs | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) 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 abb3fabb1..b23cd7f75 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, "~> 0.20 or ~> 1.0", "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"},