Merge pull request #2244 from jekyll/xml-escape-nil
This commit is contained in:
commit
702d5520d4
|
@ -83,7 +83,7 @@ module Jekyll
|
|||
#
|
||||
# Returns the escaped String.
|
||||
def xml_escape(input)
|
||||
CGI.escapeHTML(input)
|
||||
CGI.escapeHTML(input.to_s)
|
||||
end
|
||||
|
||||
# CGI escape a string for use in a URL. Replaces any special characters
|
||||
|
|
|
@ -93,6 +93,10 @@ class TestFilters < Test::Unit::TestCase
|
|||
assert_equal "<code>command &lt;filename&gt;</code>", @filter.xml_escape("<code>command <filename></code>")
|
||||
end
|
||||
|
||||
should "not error when xml escaping nil" do
|
||||
assert_equal "", @filter.xml_escape(nil)
|
||||
end
|
||||
|
||||
should "escape space as plus" do
|
||||
assert_equal "my+things", @filter.cgi_escape("my things")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue