Using same markdown config as other instances (#15341)

Prior to this commit, this instantiation of `Redcarpet::Markdown` was
different from the other instantiations.  The other ones all included
the second paramenter (e.g., `Constants::Redcarpet::CONFIG`).

My question is, should we (or can we) be using the same configuration in
all cases?
This commit is contained in:
Jeremy Friesen 2021-11-12 09:25:33 -05:00 committed by GitHub
parent f6dc6c1112
commit e35f4880d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,7 +41,7 @@ class DisplayAd < ApplicationRecord
def process_markdown
renderer = Redcarpet::Render::HTMLRouge.new(hard_wrap: true, filter_html: false)
markdown = Redcarpet::Markdown.new(renderer)
markdown = Redcarpet::Markdown.new(renderer, Constants::Redcarpet::CONFIG)
initial_html = markdown.render(body_markdown)
stripped_html = ActionController::Base.helpers.sanitize initial_html,
tags: ALLOWED_TAGS,