Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/beacon/template/markdown.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down