diff --git a/lib/redmine/syntax_highlighting.rb b/lib/redmine/syntax_highlighting.rb index a1f94a175..b388262c3 100644 --- a/lib/redmine/syntax_highlighting.rb +++ b/lib/redmine/syntax_highlighting.rb @@ -20,7 +20,6 @@ module Redmine class << self attr_reader :highlighter - delegate :highlight_by_filename, :highlight_by_language, :to => :highlighter def highlighter=(name) if name.is_a?(Module) @@ -29,6 +28,18 @@ module Redmine @highlighter = const_get(name) end end + + def highlight_by_filename(text, filename) + highlighter.highlight_by_filename(text, filename) + rescue + ERB::Util.h(text) + end + + def highlight_by_language(text, language) + highlighter.highlight_by_language(text, language) + rescue + ERB::Util.h(text) + end end module CodeRay