Index: lib/redmine/wiki_formatting/textile/formatter.rb =================================================================== --- lib/redmine/wiki_formatting/textile/formatter.rb (revision 3076) +++ lib/redmine/wiki_formatting/textile/formatter.rb (working copy) @@ -55,7 +55,7 @@ content = @pre_list[$1.to_i] if content.match(/\s?(.+)/m) content = "" + - CodeRay.scan($2, $1.downcase).html(:escape => false, :line_numbers => :inline) + CodeRay.scan($2, $1.downcase).redmineHtml() end content end @@ -179,6 +179,31 @@ end end end + + # Load standart HTML Encoder + CodeRay::Encoders::load :html + + # Create custom Encoder + class RedmineHtmlEncoder < CodeRay::Encoders::HTML + register_for :redmineHtml + + DEFAULT_OPTIONS = CodeRay::Encoders::HTML::DEFAULT_OPTIONS.merge \ + :line_numbers => :inline + + def token text, type = :plain + case text + when String + @opened[0] = type + if text != "\n" && style = @css_style[@opened] + @out << style << text << '' + else + @out << text + end + else + super + end + end + end end end end