Merge remote branch 'claco/uri-escape'
This commit is contained in:
commit
f7ab019a39
|
@ -1,3 +1,5 @@
|
|||
require 'uri'
|
||||
|
||||
module Jekyll
|
||||
|
||||
module Filters
|
||||
|
@ -25,6 +27,10 @@ module Jekyll
|
|||
CGI::escape(input)
|
||||
end
|
||||
|
||||
def uri_escape(input)
|
||||
URI.escape(input)
|
||||
end
|
||||
|
||||
def number_of_words(input)
|
||||
input.split.length
|
||||
end
|
||||
|
|
|
@ -45,5 +45,9 @@ class TestFilters < Test::Unit::TestCase
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue