removed cgi unescape in page destination

This commit is contained in:
Anand Narayan 2013-06-15 18:35:43 +05:30
parent 7ee89982e8
commit 5c47014c90
3 changed files with 16 additions and 3 deletions

View File

@ -134,9 +134,7 @@ module Jekyll
#
# Returns the destination file path String.
def destination(dest)
# The url needs to be unescaped in order to preserve the correct
# filename.
path = File.join(dest, CGI.unescape(self.url))
path = File.join(dest, self.url)
path = File.join(path, "index.html") if self.url =~ /\/$/
path
end

6
test/source/+/foo.md Normal file
View File

@ -0,0 +1,6 @@
---
layout: default
title : Page inside +
---
Line 1
{{ page.title }}

View File

@ -127,6 +127,15 @@ class TestPage < Test::Unit::TestCase
assert File.exists?(File.join(dest_dir, 'contacts.html'))
end
should "write even when the folder name is plus" do
page = setup_page('+', 'foo.md')
do_render(page)
page.write(dest_dir)
assert File.directory?(dest_dir)
assert File.exists?(File.join(dest_dir, '+', 'foo.html'))
end
should "write properly without html extension" do
page = setup_page('contacts.html')
page.site.permalink_style = :pretty