Permalink
Browse files

Fixed accent problems in permalinks

  • Loading branch information...
1 parent 92a0e3b commit cb85b28f6ff6109da0d816872c8d88ac0eb19cf2 @jbbarth jbbarth committed Feb 1, 2009
Showing with 2 additions and 0 deletions.
  1. +2 −0 app/models/post.rb
View
@@ -161,6 +161,8 @@ def self.create_clean_content(input, text_filter = Preference.get_setting('TEXT_
def self.to_permalink(input = '', current_id = nil, number_words = 5, extra_word = 'again', previous_output = nil, loops = 0, added = 0, word_spacer = '_')
# strip html tags and lowercase first
words = Post.strip_html(input.downcase)
+ # transform non alphanumeric letters
+ words.gsub!(/\W/,'-')
# 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 cb85b28

Please sign in to comment.