diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6654a7310..5670b2462 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1180,7 +1180,7 @@ module ApplicationHelper def sanitize_anchor_name(anchor) if ''.respond_to?(:encoding) || RUBY_PLATFORM == 'java' - anchor.gsub(%r{[^\p{Word}\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-') + anchor.gsub(%r{[^\s\-\p{Word}]}, '').gsub(%r{\s+(\-+\s*)?}, '-') else # TODO: remove when ruby1.8 is no longer supported anchor.gsub(%r{[^\w\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-')