Merge pull request #1215 from sanandnarayan/folder_plus
removed cgi unescape in page destination
This commit is contained in:
commit
c1850a38f7
|
@ -134,9 +134,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns the destination file path String.
|
# Returns the destination file path String.
|
||||||
def destination(dest)
|
def destination(dest)
|
||||||
# The url needs to be unescaped in order to preserve the correct
|
path = File.join(dest, self.url)
|
||||||
# filename.
|
|
||||||
path = File.join(dest, CGI.unescape(self.url))
|
|
||||||
path = File.join(path, "index.html") if self.url =~ /\/$/
|
path = File.join(path, "index.html") if self.url =~ /\/$/
|
||||||
path
|
path
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title : Page inside +
|
||||||
|
permalink: plus+in+url
|
||||||
|
---
|
||||||
|
Line 1
|
||||||
|
{{ page.title }}
|
|
@ -127,6 +127,15 @@ class TestPage < Test::Unit::TestCase
|
||||||
assert File.exists?(File.join(dest_dir, 'contacts.html'))
|
assert File.exists?(File.join(dest_dir, 'contacts.html'))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "write even when the folder name is plus and permalink has +" 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, '+', 'plus+in+url'))
|
||||||
|
end
|
||||||
|
|
||||||
should "write properly without html extension" do
|
should "write properly without html extension" do
|
||||||
page = setup_page('contacts.html')
|
page = setup_page('contacts.html')
|
||||||
page.site.permalink_style = :pretty
|
page.site.permalink_style = :pretty
|
||||||
|
|
Loading…
Reference in New Issue