Convert slashes in titles to dashes when migrating from WordPress

When a post has a title that contains a slash, such as 'This is my cool
blog post part 1/2', convert the slash to a dash so that the post
filename is created correctly.

Fixes issue #680
This commit is contained in:
Matt Rogers
2012-12-04 20:45:20 -06:00
parent fa8400ab61
commit 8fb4e8fcca
5 changed files with 28 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
require 'helper'
require 'jekyll/migrators/wordpressdotcom'
class TestWordpressDotComMigrator < Test::Unit::TestCase
should "clean slashes from slugs" do
test_title = "blogs part 1/2"
assert_equal("blogs-part-1-2", Jekyll::WordpressDotCom.sluggify(test_title))
end
end