diff --git a/lib/gollum/page.rb b/lib/gollum/page.rb index aae9ca32..d5135e80 100644 --- a/lib/gollum/page.rb +++ b/lib/gollum/page.rb @@ -327,7 +327,7 @@ module Gollum # Returns the String canonical name. def self.cname(name, char_white_sub = '-', char_other_sub = '-') name.respond_to?(:gsub) ? - name.gsub(%r{\s},char_white_sub).gsub(%r{[/<>+]}, char_other_sub) : + name.gsub(%r{\s},char_white_sub).gsub(%r{[<>+]}, char_other_sub) : '' end diff --git a/test/test_page.rb b/test/test_page.rb index fb41a792..ec8fd7fd 100644 --- a/test/test_page.rb +++ b/test/test_page.rb @@ -99,7 +99,8 @@ context "Page" do test "cname" do assert_equal "Foo", Gollum::Page.cname("Foo") assert_equal "Foo-Bar", Gollum::Page.cname("Foo Bar") - assert_equal "Foo---Bar", Gollum::Page.cname("Foo / Bar") + # / is now a directory delimiter so it must be preserved + assert_equal "Foo-/-Bar", Gollum::Page.cname("Foo / Bar") assert_equal "José", Gollum::Page.cname("José") assert_equal "モルドール", Gollum::Page.cname("モルドール") end