gem "coderay", "~> 1.1.0"
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
gem "builder", "3.0.0"
-# TODO: upgrade to redcarpet 3.x when ruby1.8 support is dropped
-gem "redcarpet", "~> 2.3.0"
# Optional gem for LDAP authentication
group :ldap do
gem "rack-openid"
end
-# Optional gem for exporting the gantt to a PNG file, not supported with jruby
platforms :mri, :mingw do
+ # Optional gem for exporting the gantt to a PNG file, not supported with jruby
group :rmagick do
# RMagick 2 supports ruby 1.9
# RMagick 1 would be fine for ruby 1.8 but Bundler does not support
# different requirements for the same gem on different platforms
gem "rmagick", ">= 2.0.0"
end
+
+ # Optional Markdown support, not for JRuby
+ group :markdown do
+ # TODO: upgrade to redcarpet 3.x when ruby1.8 support is dropped
+ gem "redcarpet", "~> 2.3.0"
+ end
end
platforms :jruby do
rescue LoadError
# RMagick is not available
end
+begin
+ require 'Redcarpet' unless Object.const_defined?(:Redcarpet)
+rescue LoadError
+ # Redcarpet is not available
+end
require 'redmine/scm/base'
require 'redmine/access_control'
Redmine::WikiFormatting.map do |format|
format.register :textile, Redmine::WikiFormatting::Textile::Formatter, Redmine::WikiFormatting::Textile::Helper
- format.register :markdown, Redmine::WikiFormatting::Markdown::Formatter, Redmine::WikiFormatting::Markdown::Helper,
- :label => 'Markdown (experimental)'
+ if Object.const_defined?(:Redcarpet)
+ format.register :markdown, Redmine::WikiFormatting::Markdown::Formatter, Redmine::WikiFormatting::Markdown::Helper,
+ :label => 'Markdown (experimental)'
+ end
end
ActionView::Template.register_template_handler :rsb, Redmine::Views::ApiTemplateHandler
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'cgi'
+require 'redmine/scm/adapters'
if RUBY_VERSION < '1.9'
require 'iconv'
class Redmine::WikiFormatting::MarkdownFormatterTest < ActionView::TestCase
include ApplicationHelper
+ if Object.const_defined?(:Redcarpet)
+
def setup
@formatter = Redmine::WikiFormatting::Markdown::Formatter
end
text = 'This is a [link](/issues)'
assert_equal '<p>This is a <a href="/issues">link</a></p>', @formatter.new(text).to_html.strip
end
+
+ end
end