Add parserTests for tilde and equals signs in links.
authorC. Scott Ananian <cscott@cscott.net>
Thu, 25 Apr 2013 15:55:59 +0000 (11:55 -0400)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 25 Apr 2013 17:52:00 +0000 (17:52 +0000)
The Parsoid team stumbled over bugs here; adding to parserTests to prevent
future regressions.

Change-Id: Iad599aef9e3a6e62bb8a447bf955eb98230e81cf

tests/parser/parserTests.txt

index b34c957..bf25182 100644 (file)
@@ -3969,6 +3969,33 @@ Link containing "<#" and ">#" as a hex sequences
 </p>
 !! end
 
+!! test
+Link containing an equals sign
+!! input
+[[Special:BookSources/isbn=4-00-026157-6]]
+!! result
+<p><a href="/wiki/Special:BookSources/isbn%3D4-00-026157-6" title="Special:BookSources/isbn=4-00-026157-6">Special:BookSources/isbn=4-00-026157-6</a>
+</p>
+!! end
+
+!! article
+Foo~bar
+!! text
+Just a test of an article title containing a tilde.
+!! endarticle
+
+# note that links containing signatures, like [[Foo~~~~]], are
+# massaged by the pre-save transform (PST) and so the tildes are never
+# seen by the parser.
+!! test
+Link containing a tilde
+!! input
+[[Foo~bar]]
+!! result
+<p><a href="/wiki/Foo%7Ebar" title="Foo~bar">Foo~bar</a>
+</p>
+!! end
+
 !! test
 Link containing double-single-quotes '' (bug 4598)
 !! input