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,
            // http(s)://foo.com
            // httpRgx = /(\s*)(https?:\/\/[^\s]+)(\s*)/g,
             // [[pagename]] -> [[$1]]
             // [[pagename]] -> [[$1]]
             simplePageRgx = /\[\[([^|]*?)\]\]/g,
             simplePageRgx = /\[\[([^|]*?)\]\]/g,
Line 429: Line 427:
                 return makeLink(href, text, true);
                 return makeLink(href, text, true);
             })
             })
            // .replace(httpRgx, function (_match, before, href, after) {
            //    return before + makeLink(href, href, true) + after;
            // })
             .replace(simplePageRgx, function (_match, href) {
             .replace(simplePageRgx, function (_match, href) {
                 return makeLink(href);
                 return makeLink(href);
Cookies help us deliver our services. By using our services, you agree to our use of cookies.