about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-05-23 18:53:24 +0200
committermultiple creatures <dev@multiple-creature.party>2019-11-19 13:35:52 -0600
commitb49fdce78429f65a20df2d7c7c9eb61fd15539f8 (patch)
tree2331a067ee3d871c57556369bc2635dcee377ab6 /app
parentf6bd1629b9436198b35d36103a8faaefd139b298 (diff)
Do not share a single Redcarpet::Markdown object across threads
There are apparently thread-safety issues: https://github.com/vmg/redcarpet/pull/672
Diffstat (limited to 'app')
-rw-r--r--app/lib/formatter.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index bdd372d3e..31cfc8220 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -349,8 +349,6 @@ class Formatter
   end
 
   def markdown_formatter
-    return @markdown_formatter if defined?(@markdown_formatter)
-
     extensions = {
       autolink: true,
       no_intra_emphasis: true,
@@ -375,7 +373,7 @@ class Formatter
       link_attributes: { target: '_blank', rel: 'nofollow noopener' },
     })
 
-    @markdown_formatter = Redcarpet::Markdown.new(renderer, extensions)
+    Redcarpet::Markdown.new(renderer, extensions)
   end
 
   def html_entities