about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-05-23 18:53:24 +0200
committerThibG <thib@sitedethib.com>2019-05-23 21:19:44 +0200
commitd6a7d62dc698d6ebaa3a40f44c20ef12f8474fd7 (patch)
tree9e2fbdcb2ae7a100db27d7271c029f0ff2bedd93
parentc394d3cb25ad39f169fbf45d18153a51d34c43ad (diff)
Do not share a single Redcarpet::Markdown object across threads
There are apparently thread-safety issues: https://github.com/vmg/redcarpet/pull/672
-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 a099ff728..8a2828bbf 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -137,8 +137,6 @@ class Formatter
   private
 
   def markdown_formatter
-    return @markdown_formatter if defined?(@markdown_formatter)
-
     extensions = {
       autolink: true,
       no_intra_emphasis: true,
@@ -163,7 +161,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