mirror of
https://github.com/redmine/redmine.git
synced 2025-10-26 07:46:17 +01:00
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
This commit is contained in:
6
Gemfile
6
Gemfile
@@ -18,6 +18,7 @@ gem 'propshaft', '~> 1.1.0'
|
||||
gem 'rack', '>= 3.1.3'
|
||||
gem "stimulus-rails", "~> 1.3"
|
||||
gem "importmap-rails", "~> 2.0"
|
||||
gem 'commonmarker', '~> 2.3.0'
|
||||
|
||||
# Ruby Standard Gems
|
||||
gem 'csv', '~> 3.3.2'
|
||||
@@ -46,11 +47,6 @@ group :minimagick do
|
||||
gem 'mini_magick', '~> 5.2.0'
|
||||
end
|
||||
|
||||
# Optional CommonMark support, not for JRuby
|
||||
group :common_mark do
|
||||
gem "commonmarker", '~> 2.3.0'
|
||||
end
|
||||
|
||||
# Include database gems for the adapters found in the database
|
||||
# configuration file
|
||||
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -408,10 +408,8 @@ module Redmine
|
||||
|
||||
WikiFormatting.map do |format|
|
||||
format.register :textile
|
||||
if Object.const_defined?(:Commonmarker)
|
||||
format.register :common_mark, label: 'CommonMark Markdown (GitHub Flavored)'
|
||||
end
|
||||
end
|
||||
|
||||
ActionView::Template.register_template_handler :rsb, Views::ApiTemplateHandler
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user