trac-wiki 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/trac-wiki/parser.rb +4 -3
- data/lib/trac-wiki/version.rb +1 -1
- data/test/parser_test.rb +3 -1
- metadata +1 -1
data/lib/trac-wiki/parser.rb
CHANGED
@@ -277,11 +277,12 @@ module TracWiki
|
|
277
277
|
end
|
278
278
|
|
279
279
|
if no_link?
|
280
|
-
|
281
|
-
|
280
|
+
if uri !~ /^(ftp|https?):/
|
281
|
+
@out << escape_html(whole)
|
282
|
+
return
|
283
|
+
end
|
282
284
|
end
|
283
285
|
|
284
|
-
make_explicit_link(link)
|
285
286
|
@out << '<a href="' << escape_html(uri) << '">'
|
286
287
|
if content
|
287
288
|
until content.empty?
|
data/lib/trac-wiki/version.rb
CHANGED
data/test/parser_test.rb
CHANGED
@@ -468,7 +468,9 @@ describe TracWiki::Parser do
|
|
468
468
|
# Not escaping inside URLs
|
469
469
|
tc "<p><a href=\"http://example.org/~user/\">http://example.org/~user/</a></p>\n", "http://example.org/~user/"
|
470
470
|
tc "<p><a href=\"http://example.org/~user/\">http://example.org/~user/</a></p>\n", "[http://example.org/~user/]"
|
471
|
-
tc "<p>
|
471
|
+
tc "<p><a href=\"http://example.org/~user/\">http://example.org/~user/</a></p>\n", "[http://example.org/~user/]", :no_link=>true
|
472
|
+
tc "<p><a href=\"http://example.org/~user/\">http://example.org/~user/</a></p>\n", "[[http://example.org/~user/]]", :no_link=>true
|
473
|
+
tc "<p><a href=\"http://example.org/~user/\">http://example.org/~user/</a></p>\n", "[[http://example.org/~user/]]"
|
472
474
|
|
473
475
|
# Escaping links
|
474
476
|
tc "<p>http://www.example.org/</p>\n", "!http://www.example.org/"
|