whitelist apt uri schemes, fixes #233
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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>"
|
||||
|
||||
Reference in New Issue
Block a user