trac-wiki 0.0.9 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/"
|