Permalink
Browse files

Merge remote branch 'claco/uri-escape'

  • Loading branch information...
2 parents 4afee1b + 4c08643 commit f7ab019a393bfe25041e9eb051cb61005fa6f79f @mojombo mojombo committed Nov 17, 2010
Showing with 10 additions and 0 deletions.
  1. +6 −0 lib/jekyll/filters.rb
  2. +4 −0 test/test_filters.rb
View
@@ -1,3 +1,5 @@
+require 'uri'
+
module Jekyll
module Filters
@@ -25,6 +27,10 @@ def cgi_escape(input)
CGI::escape(input)
end
+ def uri_escape(input)
+ URI.escape(input)
+ end
+
def number_of_words(input)
input.split.length
end
View
@@ -45,5 +45,9 @@ class JekyllFilter
should "escape special characters" do
assert_equal "hey%21", @filter.cgi_escape("hey!")
end
+
+ should "escape space as %20" do
+ assert_equal "my%20things", @filter.uri_escape("my things")
+ end
end
end

0 comments on commit f7ab019

Please sign in to comment.