summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2025-05-01 10:28:14 +0000
committerGo MAEDA <maeda@farend.jp>2025-05-01 10:28:14 +0000
commit444a94c7cbbfc7baff254fb36682350fb902124a (patch)
treedbae9dad11b6b75fb50f4119d07513757adce56a /lib
parent2ec9ee5a32c8b06dfff33adaa63d368be05125bb (diff)
downloadredmine-444a94c7cbbfc7baff254fb36682350fb902124a.tar.gz
redmine-444a94c7cbbfc7baff254fb36682350fb902124a.zip
Make commonmarker gem required to avoid runtime error (#37394).
Although the commonmarker gem is marked as optional in the Gemfile, Redmine fails to start without it, raising a NameError: "uninitialized constant Redmine::WikiFormatting::CommonMark::HTML". This patch makes the gem required to ensure Redmine starts correctly. git-svn-id: https://svn.redmine.org/redmine/trunk@23734 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine.rb5
-rw-r--r--lib/redmine/preparation.rb4
2 files changed, 1 insertions, 8 deletions
diff --git a/lib/redmine.rb b/lib/redmine.rb
index 95b3b7f3f..78a1a6d8c 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -24,11 +24,6 @@ begin
rescue LoadError
# MiniMagick is not available
end
-begin
- require 'commonmarker' unless Object.const_defined?(:Commonmarker)
-rescue LoadError
- # CommonMarker is not available
-end
module Redmine
end
diff --git a/lib/redmine/preparation.rb b/lib/redmine/preparation.rb
index 822662e11..a31204904 100644
--- a/lib/redmine/preparation.rb
+++ b/lib/redmine/preparation.rb
@@ -408,9 +408,7 @@ module Redmine
WikiFormatting.map do |format|
format.register :textile
- if Object.const_defined?(:Commonmarker)
- format.register :common_mark, label: 'CommonMark Markdown (GitHub Flavored)'
- end
+ format.register :common_mark, label: 'CommonMark Markdown (GitHub Flavored)'
end
ActionView::Template.register_template_handler :rsb, Views::ApiTemplateHandler