MediaWiki:Gadget-libExtraUtil.js: Difference between revisions
Content deleted Content added
Version 2.2.2: parseTemplates: recognise three braces ( {{{parameter}}} ) as not being a template - may occur when a template has been subst'ed |
Drop polyfills per request |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 5:
* | Please discuss changes on the talk page or on [[WT:Gadget]] before editing. |
* |_____________________________________________________________________________|
*
* ###############################################################################
* # #
* # This script has unit tests on its /testcases.js subpage. Please install #
* # the WikiUnit script [[User:Evad37/WikiUnit]] and run tests before saving. #
* # #
* ###############################################################################
*
* Imported from version 924857650 as of 14 November 2019 from [[User:Evad37/extra.js]]
Line 17 ⟶ 24:
// <nowiki>
window.extraJs = { version: '2.
/**
Line 51 ⟶ 34:
*
* @param {string} code
* First
* @param {jQuery.jqXHR} jqxhr
* Second
* @return {string} Error message details, with in a format like
* "(API|HTTP) error: details"
Line 759 ⟶ 742:
}
// Mark any other list items with backlinks for manual review, using {{subst:void}}
var manual_review_regex = new RegExp(
'^(\\*+.*)( simple_regex_str.replace(/([^\\])\(([^?])/g, "$1(?:$2") + // replace capturing groups with non-capturing groups
named_regex_str + ').*$', 'gm' );▼
'|' +
wikitext = wikitext.replace(manual_review_regex, '{{subst:void}}$&');▼
named_regex_str.replace(/([^\\])\(([^?])/g, "$1(?:$2") + // replace capturing groups with non-capturing groups
▲ wikitext = wikitext.replace(manual_review_regex, '{{subst:void}}$
// For all other links, replace with unlinked text
|