To render Markdown as HTML in Elixir, use MDEx.to_html!/2 with the appropriate options:

MDEx.to_html!(
  extension: [
    strikethrough: true,
    tagfilter: true,
    table: true,
    autolink: true,
    tasklist: true,
    footnotes: true,
    shortcodes: true
  ],
  render: [unsafe_: true, escape: false],
  syntax_highlight: [formatter: :html_linked]
)

This enables support for extended Markdown features and syntax highlighting. The schema for the options can be found here.

The formatter uses linked CSS styles, so you’ll need to include them manually in your frontend. You can download the CSS from the Autumn theme repo.