whitelist apt uri schemes, fixes #233
This commit is contained in:
@@ -43,7 +43,7 @@ module Gollum
|
|||||||
|
|
||||||
# Default whitelisted protocols for URLs.
|
# Default whitelisted protocols for URLs.
|
||||||
PROTOCOLS = {
|
PROTOCOLS = {
|
||||||
'a' => {'href' => ['http', 'https', 'mailto', 'ftp', 'irc', :relative]},
|
'a' => {'href' => ['http', 'https', 'mailto', 'ftp', 'irc', 'apt', :relative]},
|
||||||
'img' => {'src' => ['http', 'https', :relative]}
|
'img' => {'src' => ['http', 'https', :relative]}
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
|
|||||||
@@ -495,6 +495,13 @@ np.array([[2,2],[1,3]],np.float)
|
|||||||
compare(content, output)
|
compare(content, output)
|
||||||
end
|
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
|
test "removes style blocks completely" do
|
||||||
content = "<style>body { color: red }</style>foobar"
|
content = "<style>body { color: red }</style>foobar"
|
||||||
output = "<p>foobar</p>"
|
output = "<p>foobar</p>"
|
||||||
|
|||||||
Reference in New Issue
Block a user