parserTests: Add parser test with filename containing single quotes
authorFomafix <fomafix@googlemail.com>
Wed, 7 Aug 2019 19:53:51 +0000 (21:53 +0200)
committerFomafix <fomafix@googlemail.com>
Wed, 7 Aug 2019 21:50:56 +0000 (23:50 +0200)
This parser test reflects the current behavior of the parser with
filenames containing single quotes. The behavior can changed by future
changes of the parser.

Change-Id: I6dbeb6c1b8ab356d9d4372597957cd0ad01040a2

tests/parser/parserTests.txt

index 7046a7f..7efa8e3 100644 (file)
@@ -8079,6 +8079,17 @@ File containing double quotes and spaces
 <p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Cool_%22Gator%22.png"><span resource='./File:Cool_"Gator".png' data-parsoid='{"a":{"resource":"./File:Cool_\"Gator\".png"},"sa":{"resource":"File:Cool \"Gator\".png"}}'>File:Cool "Gator".png</span></a></figure-inline></p>
 !! end
 
+!! test
+File containing single quotes
+!! wikitext
+[[File:Foo's ''italic'' bar.jpg]]
+[[File:Foo's ''italic'' bar.jpg|Foo's ''italic'' bar]]
+!! html/php+tidy
+<p><a href="/index.php?title=Special:Upload&amp;wpDestFile=Foo%27s_%27%27italic%27%27_bar.jpg" class="new" title="File:Foo&#39;s &#39;&#39;italic&#39;&#39; bar.jpg">File:Foo's <i>italic</i> bar.jpg</a>
+<a href="/index.php?title=Special:Upload&amp;wpDestFile=Foo%27s_%27%27italic%27%27_bar.jpg" class="new" title="File:Foo&#39;s &#39;&#39;italic&#39;&#39; bar.jpg">Foo's italic bar</a>
+</p>
+!! end
+
 !! test
 Redirect containing double quotes and spaces
 !! wikitext