Skip to content

Commit

Permalink
Do not share a single Redcarpet::Markdown object across threads
Browse files Browse the repository at this point in the history
There are apparently thread-safety issues: vmg/redcarpet#672
  • Loading branch information
ClearlyClaire committed May 23, 2019
1 parent 0744d6e commit a9a69f3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/lib/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ def link_url(url)
private

def markdown_formatter
return @markdown_formatter if defined?(@markdown_formatter)

extensions = {
autolink: true,
no_intra_emphasis: true,
Expand All @@ -163,7 +161,7 @@ def markdown_formatter
link_attributes: { target: '_blank', rel: 'nofollow noopener' },
})

@markdown_formatter = Redcarpet::Markdown.new(renderer, extensions)
Redcarpet::Markdown.new(renderer, extensions)
end

def html_entities
Expand Down

0 comments on commit a9a69f3

Please sign in to comment.