Index: Gemfile
===================================================================
--- Gemfile (revision 10206)
+++ Gemfile (working copy)
@@ -6,6 +6,7 @@
gem "coderay", "~> 1.0.6"
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
gem "builder"
+gem "stringex"
# Optional gem for LDAP authentication
group :ldap do
Index: test/unit/helpers/application_helper_test.rb
===================================================================
--- test/unit/helpers/application_helper_test.rb (revision 10206)
+++ test/unit/helpers/application_helper_test.rb (working copy)
@@ -529,7 +529,7 @@
'[[CookBook documentation#One-section]]' => 'CookBook documentation',
'[[Another page#anchor|Page]]' => 'Page',
# UTF8 anchor
- '[[Another_page#Тест|Тест]]' => %|Тест|,
+ '[[Another_page#Тест|Тест]]' => %|Тест|,
# page that doesn't exist
'[[Unknown page]]' => 'Unknown page',
'[[Unknown page|404]]' => '404',
Index: app/helpers/application_helper.rb
===================================================================
--- app/helpers/application_helper.rb (revision 10206)
+++ app/helpers/application_helper.rb (working copy)
@@ -1157,12 +1157,7 @@
end
def sanitize_anchor_name(anchor)
- if ''.respond_to?(:encoding)
- anchor.gsub(%r{[^\p{Word}\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
- else
- # TODO: remove when ruby1.8 is no longer supported
- anchor.gsub(%r{[^\w\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
- end
+ anchor.to_ascii.gsub(%r{[^\w\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
end
# Returns the javascript tags that are included in the html layout head