Skip to content

Commit

Permalink
Cleanup markdown sanitization
Browse files Browse the repository at this point in the history
  • Loading branch information
cycomachead committed Feb 13, 2024
1 parent c80572f commit 917b096
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/helpers/format_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ def markdown(text, escape_html = true)
safe_links_only: true
}
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(render_options), markdown_options)
escape_html ? sanitize(sanitize(markdown.render(text)), scrubber: Loofah::Scrubbers::NoFollow.new) : markdown.render(text).html_safe
rendered = sanitize(markdown.render(text))
escape_html ? sanitize(rendered, scrubber: Loofah::Scrubbers::NoFollow.new) : rendered.html_safe
end

def markdown_hint(text = '')
Expand Down

0 comments on commit 917b096

Please sign in to comment.