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