Bug: T99346
Change-Id: I459b0027c7703b2379e024d88fab74b17ebb11e9
:? # ignore optional leading colon
([^\]|]+) # 1. link target; page names cannot include ] or |
(?:\|
- # 2. a pipe-separated substring; only the last is captured
- # Stop matching at | and ]] without relying on backtracking.
- ((?:]?[^\]|])*+)
- )*
+ # 2. link text
+ # Stop matching at ]] without relying on backtracking.
+ ((?:]?[^\]])*+)
+ )?
\]\]
([^[]*) # 3. link trail (the text up until the next link)
/x',
!! end
+!! test
+Edit comment with link with more than one pipe (T99346)
+!! options
+comment
+!! wikitext
+[[Main Page|Many|pipes]]
+!! html
+<a href="/wiki/Main_Page" title="Main Page">Many|pipes</a>
+!! end
+
+!! test
+Complex edit comment with link with more than one pipe (T99346)
+!! options
+comment
+!! wikitext
+Created page with "<noinclude>[[Category:Requests for permissions/Bot|{{subst:#titleparts:{{subst:PAGENAME}}|1|3}}]]</noinclude> === [[User:MineoBot|]] 8=== {{Request for permissions/links|Mineo..."
+!! html
+Created page with "<noinclude><a href="/index.php?title=Category:Requests_for_permissions/Bot&action=edit&redlink=1" class="new" title="Category:Requests for permissions/Bot (page does not exist)">{{subst:#titleparts:{{subst:PAGENAME}}|1|3}}</a></noinclude> === <a href="/index.php?title=User:MineoBot&action=edit&redlink=1" class="new" title="User:MineoBot (page does not exist)">User:MineoBot</a> 8=== {{Request for permissions/links|Mineo..."
+!! end
+
!! test
Space normalisation on autocomment (bug 22784)
!! options