Try to paste and preview this in the wikitext as well as the summary
line: [[:a]] [[ :a]]
The wikitext will show "a a", but the summary line will show "a :a".
This is only a display issue, all 4 links correctly link to the
article [[A]].
Change-Id: I08253a6d0b55b9aa3eace519bbdc1a456400bf84
return preg_replace_callback(
'/
\[\[
+ \s*+ # ignore leading whitespace, the *+ quantifier disallows backtracking
:? # ignore optional leading colon
([^\]|]+) # 1. link target; page names cannot include ] or |
(?:\|
'foo bar [[Special:BlankPage]]',
null,
],
+ [
+ '<a href="/wiki/Special:BlankPage" title="Special:BlankPage">Special:BlankPage</a>',
+ '[[ :Special:BlankPage]]',
+ null,
+ ],
[
'<a class="external" rel="nofollow" href="//en.example.org/w/Foo%27bar">Foo\'bar</a>',
"[[Foo'bar]]",