MediaWiki:Gadget-I18n-js.js: Difference between revisions
From Tardis Wiki, the free Doctor Who reference
undo last changes - you can use [https://url text] for links (parse() isn't meant to have full wikitext support, just basics)
(Will cause some bugs) |
(undo last changes - you can use [https://url text] for links (parse() isn't meant to have full wikitext support, just basics)) |
||
Line 410: | Line 410: | ||
// [url text] -> [$1 $2] | // [url text] -> [$1 $2] | ||
var urlRgx = /\[((?:https?:)?\/\/.+?) (.+?)\]/g, | var urlRgx = /\[((?:https?:)?\/\/.+?) (.+?)\]/g, | ||
// [[pagename]] -> [[$1]] | // [[pagename]] -> [[$1]] | ||
simplePageRgx = /\[\[([^|]*?)\]\]/g, | simplePageRgx = /\[\[([^|]*?)\]\]/g, | ||
Line 429: | Line 427: | ||
return makeLink(href, text, true); | return makeLink(href, text, true); | ||
}) | }) | ||
.replace(simplePageRgx, function (_match, href) { | .replace(simplePageRgx, function (_match, href) { | ||
return makeLink(href); | return makeLink(href); |