Skip to content
Browse files

Fixed permalink generator not to break spaces

  • Loading branch information...
1 parent bf3f8e0 commit c9b1806f75b31e7189f3c37f24abedcd8187a39e @jbbarth jbbarth committed Feb 1, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/post.rb
View
2 app/models/post.rb
@@ -162,7 +162,7 @@ def self.to_permalink(input = '', current_id = nil, number_words = 5, extra_word
# strip html tags and lowercase first
words = Post.strip_html(input.downcase)
# transform non alphanumeric letters
- words.gsub!(/\W/,'-')
+ words.gsub!(/[^a-z _-]/,'-')
# dump double-dashes first, cause they can cause two words to become--one...
words.gsub!('--', ' ')
if Preference.get_setting('TEXT_FILTER') == 'markdown'

0 comments on commit c9b1806

Please sign in to comment.
Something went wrong with that request. Please try again.