Permalink
Browse files

Turn the title into a slug

This allows the title to be correctly used as a filename.
Fixes #523
  • Loading branch information...
1 parent 7d88f72 commit 73212a27079e6b9eaa45ddecb6f6d44f0e1b5cc2 @tombell tombell committed May 27, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/jekyll/migrators/wordpressdotcom.rb
@@ -19,7 +19,7 @@ def self.process(filename = "wordpress.xml")
permalink_title = item.at('wp:post_name').inner_text
# Fallback to "prettified" title if post_name is empty (can happen)
if permalink_title == ""
- permalink_title = title.downcase.split.join('-')
+ permalink_title = title.gsub(/[^[:alnum:]]+/, '-').downcase
end
date = Time.parse(item.at('wp:post_date').inner_text)

0 comments on commit 73212a2

Please sign in to comment.