whitelist apt uri schemes, fixes #233

This commit is contained in:
Corey Donohoe
2012-05-05 11:56:01 -07:00
parent 4110ab5a82
commit 9a1dddaccf
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ module Gollum
# Default whitelisted protocols for URLs.
PROTOCOLS = {
'a' => {'href' => ['http', 'https', 'mailto', 'ftp', 'irc', :relative]},
'a' => {'href' => ['http', 'https', 'mailto', 'ftp', 'irc', 'apt', :relative]},
'img' => {'src' => ['http', 'https', :relative]}
}.freeze
+7
View File
@@ -495,6 +495,13 @@ np.array([[2,2],[1,3]],np.float)
compare(content, output)
end
test "allows apt uri schemes" do
content = "[Hack me](apt:gettext)"
output = "<p><a href=\"apt:gettext\">Hackme</a></p>"
compare(content, output)
end
test "removes style blocks completely" do
content = "<style>body { color: red }</style>foobar"
output = "<p>foobar</p>"