Parser tests for protocol-relative URLs, for r91663 and r92005
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 12 Jul 2011 20:56:56 +0000 (20:56 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 12 Jul 2011 20:56:56 +0000 (20:56 +0000)
tests/parser/parserTests.txt

index 0527bb9..c59e4db 100644 (file)
@@ -714,6 +714,33 @@ second]
 </p>
 !!end
 
+!! test
+External links: protocol-relative URL in brackets
+!! input
+[//example.com/ Test]
+!! result
+<p><a rel="nofollow" class="external text" href="//example.com/">Test</a>
+</p>
+!! end
+
+!! test
+External links: protocol-relative URL in brackets without text
+!! input
+[//example.com]
+!! result
+<p><a rel="nofollow" class="external autonumber" href="//example.com">[1]</a>
+</p>
+!! end
+
+!! test
+External links: protocol-relative URL in free text is left alone
+!! input
+//example.com/Foo
+!! result
+<p>//example.com/Foo
+</p>
+!!end
+
 !! test
 External image
 !! input