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 authored and multiple creatures committed Nov 19, 2019
1 parent f6bd162 commit b49fdce
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 @@ -349,8 +349,6 @@ def bbcode_formatter(html)
end

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

extensions = {
autolink: true,
no_intra_emphasis: true,
Expand All @@ -375,7 +373,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 b49fdce

Please sign in to comment.