Safely render markdown user content
```ruby
# app/models/feedback.rb
class Feedback < ApplicationRecord
def content_html
markdown = Redcarpet::Markdown.new(
Redcarpet::Render::HTML.new(
filter_html: true, no_styles: true, safe_links_only: true
),
autolink: true, tables: true, fenced_code_blocks: true
)
html = markdown.render(content)
ActionController::Base.helpers.sanitize(
html,
tags: %w[p br strong em a ul ol li pre code h1 h2 h3 blockquote],
attributes: %w[href title]
)
end
end
```
**View:**
```erb
<%= @feedback.content_html.html_safe %>
```
**Why Safe:** Markdown filtered for HTML, output sanitized with allowlist, double protection layer.