Add parser test for "Piped link with empty link text"
[lhc/web/wiklou.git] / tests / parser / parserTests.txt
index 9fe3029..5b17eac 100644 (file)
@@ -7440,6 +7440,23 @@ Piped link with no link text
 <p>[[Thomas Bek (bishop of St David's)|]]</p>
 !! end
 
+!! test
+Piped link with empty link text
+!! wikitext
+[[Main Page|<nowiki />]] - empty nowiki
+[[Main Page| ]] - empty space
+[[Main Page|&nbsp;]] - empty non breaking space
+!! html/php
+<p><a href="/wiki/Main_Page" title="Main Page"></a> - empty nowiki
+<a href="/wiki/Main_Page" title="Main Page"> </a> - empty space
+<a href="/wiki/Main_Page" title="Main Page">&#160;</a> - empty non breaking space
+</p>
+!! html/parsoid
+<p><a rel="mw:WikiLink" href="./Main_Page" title="Main Page"><meta typeof="mw:Placeholder" data-parsoid='{"src":"&lt;nowiki />"}'/></a> - empty nowiki
+<a rel="mw:WikiLink" href="./Main_Page" title="Main Page"> </a> - empty space
+<a rel="mw:WikiLink" href="./Main_Page" title="Main Page"><span typeof="mw:Entity" data-parsoid='{"src":"&amp;nbsp;","srcContent":" "}'> </span></a> - empty non breaking space</p>
+!! end
+
 !! test
 Broken link
 !! wikitext