Browse Source

fix: render markdown link instead of html

main
Inhji Y. 8 months ago
parent
commit
b9f1ded98d
  1. 4
      lib/mirage/markdown.ex

4
lib/mirage/markdown.ex

@ -1,6 +1,4 @@
defmodule Mirage.Markdown do
import Phoenix.HTML.Link, only: [link: 2]
import Phoenix.HTML, only: [safe_to_string: 1]
import Ecto.Changeset, only: [get_change: 2, put_change: 3]
def maybe_render_markdown(changeset, markdown_field, html_field) do
@ -52,6 +50,6 @@ defmodule Mirage.Markdown do
end
def get_link(id, title) do
link(title, to: "/notes/#{id}") |> safe_to_string()
"[#{title}](/notes/#{id})"
end
end

Loading…
Cancel
Save