mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-23 14:07:01 +00:00
pygments.links.js: Handle empty wikilinks and pipe trick
Skip empty wikilink `[[]]` and reverse pipe trick `[[|foo]]` where valid and correct title cannot be generated respectively. Bug: T368166 Change-Id: I5df409c8aa104d93a62cd5c0dbd671d598b7c79e
This commit is contained in:
parent
73f8f3ef71
commit
fea9546eb1
|
@ -33,7 +33,7 @@ $( () => {
|
|||
|
||||
link.href = url;
|
||||
linkText = URLMatch[ 0 ]; // Preserve visual link text as is
|
||||
} else if ( wikilinkMatch ) {
|
||||
} else if ( wikilinkMatch && wikilinkMatch[ 1 ] ) {
|
||||
linkText = wikilinkMatch[ 0 ];
|
||||
title = mw.Title.newFromText( wikilinkMatch[ 1 ] );
|
||||
} else if ( templateMatch ) {
|
||||
|
|
Loading…
Reference in a new issue