@@ -5,8 +5,6 gem "jquery-rails", "~> 2.0.2" | |||
|
5 | 5 | gem "coderay", "~> 1.1.0" |
|
6 | 6 | gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby] |
|
7 | 7 | gem "builder", "3.0.0" |
|
8 | # TODO: upgrade to redcarpet 3.x when ruby1.8 support is dropped | |
|
9 | gem "redcarpet", "~> 2.3.0" | |
|
10 | 8 | |
|
11 | 9 | # Optional gem for LDAP authentication |
|
12 | 10 | group :ldap do |
@@ -19,14 +17,20 group :openid do | |||
|
19 | 17 | gem "rack-openid" |
|
20 | 18 | end |
|
21 | 19 | |
|
22 | # Optional gem for exporting the gantt to a PNG file, not supported with jruby | |
|
23 | 20 | platforms :mri, :mingw do |
|
21 | # Optional gem for exporting the gantt to a PNG file, not supported with jruby | |
|
24 | 22 | group :rmagick do |
|
25 | 23 | # RMagick 2 supports ruby 1.9 |
|
26 | 24 | # RMagick 1 would be fine for ruby 1.8 but Bundler does not support |
|
27 | 25 | # different requirements for the same gem on different platforms |
|
28 | 26 | gem "rmagick", ">= 2.0.0" |
|
29 | 27 | end |
|
28 | ||
|
29 | # Optional Markdown support, not for JRuby | |
|
30 | group :markdown do | |
|
31 | # TODO: upgrade to redcarpet 3.x when ruby1.8 support is dropped | |
|
32 | gem "redcarpet", "~> 2.3.0" | |
|
33 | end | |
|
30 | 34 | end |
|
31 | 35 | |
|
32 | 36 | platforms :jruby do |
@@ -22,6 +22,11 begin | |||
|
22 | 22 | rescue LoadError |
|
23 | 23 | # RMagick is not available |
|
24 | 24 | end |
|
25 | begin | |
|
26 | require 'Redcarpet' unless Object.const_defined?(:Redcarpet) | |
|
27 | rescue LoadError | |
|
28 | # Redcarpet is not available | |
|
29 | end | |
|
25 | 30 | |
|
26 | 31 | require 'redmine/scm/base' |
|
27 | 32 | require 'redmine/access_control' |
@@ -267,8 +272,10 end | |||
|
267 | 272 | |
|
268 | 273 | Redmine::WikiFormatting.map do |format| |
|
269 | 274 | format.register :textile, Redmine::WikiFormatting::Textile::Formatter, Redmine::WikiFormatting::Textile::Helper |
|
270 | format.register :markdown, Redmine::WikiFormatting::Markdown::Formatter, Redmine::WikiFormatting::Markdown::Helper, | |
|
271 | :label => 'Markdown (experimental)' | |
|
275 | if Object.const_defined?(:Redcarpet) | |
|
276 | format.register :markdown, Redmine::WikiFormatting::Markdown::Formatter, Redmine::WikiFormatting::Markdown::Helper, | |
|
277 | :label => 'Markdown (experimental)' | |
|
278 | end | |
|
272 | 279 | end |
|
273 | 280 | |
|
274 | 281 | ActionView::Template.register_template_handler :rsb, Redmine::Views::ApiTemplateHandler |
@@ -16,6 +16,7 | |||
|
16 | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | 17 | |
|
18 | 18 | require 'cgi' |
|
19 | require 'redmine/scm/adapters' | |
|
19 | 20 | |
|
20 | 21 | if RUBY_VERSION < '1.9' |
|
21 | 22 | require 'iconv' |
@@ -20,6 +20,8 require File.expand_path('../../../../../test_helper', __FILE__) | |||
|
20 | 20 | class Redmine::WikiFormatting::MarkdownFormatterTest < ActionView::TestCase |
|
21 | 21 | include ApplicationHelper |
|
22 | 22 | |
|
23 | if Object.const_defined?(:Redcarpet) | |
|
24 | ||
|
23 | 25 | def setup |
|
24 | 26 | @formatter = Redmine::WikiFormatting::Markdown::Formatter |
|
25 | 27 | end |
@@ -59,4 +61,6 STR | |||
|
59 | 61 | text = 'This is a [link](/issues)' |
|
60 | 62 | assert_equal '<p>This is a <a href="/issues">link</a></p>', @formatter.new(text).to_html.strip |
|
61 | 63 | end |
|
64 | ||
|
65 | end | |
|
62 | 66 | end |
General Comments 0
You need to be logged in to leave comments.
Login now