def uri_with_safe_scheme?(uri, schemes = ['http', 'https', 'ftp', 'mailto', nil])
# URLs relative to the current document or document root (without a protocol
# separator, should be harmless
- return true unless uri.include? ":"
+ return true unless uri.to_s.include? ":"
# Other URLs need to be parsed
schemes.include? URI.parse(uri).scheme
assert @formatter.new("!>[](foo.png)").to_html
end
+ def test_empty_image_should_not_raise_exception
+ assert @formatter.new("![]()").to_html
+ end
+
# re-using the formatter after getting above error crashes the
# ruby interpreter. This seems to be related to
# https://github.com/vmg/redcarpet/issues/318