Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrocp committed Jan 11, 2025
1 parent 9c1ca44 commit e4c6c21
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/mdex.ex
Original file line number Diff line number Diff line change
Expand Up @@ -625,16 +625,16 @@ defmodule MDEx do
`:curly_braces_in_code` - escape `{` and `}` only inside `<code>` tags, particularly useful for compiling HTML in LiveView;
"""
def safe_html(unsafe_html, opts \\ []) when is_binary(unsafe_html) and is_list(opts) do
sanitize = opt(opts, [:sanitize], true)
sanitize = opt(opts, [:sanitize], true)
escape_content = opt(opts, [:escape, :content], true)
escape_curly_braces_in_code = opt(opts, [:escape, :curly_braces_in_code], true)
Native.safe_html(unsafe_html, sanitize, escape_content, escape_curly_braces_in_code)
end

defp opt(opts, keys, default) do
case get_in(opts, keys) do
nil -> default
val -> val
end
case get_in(opts, keys) do
nil -> default
val -> val
end
end
end

0 comments on commit e4c6c21

Please sign in to comment.