MediaWiki:Gadget-morebits.js: Difference between revisions

Content deleted Content added
Repo at 3813f11: Minor jsdoc improvements; Enforce newer API error message format, defaulting to html; Teach codify to $.parseHTML in status messages; date.format: add SSS for milliseconds fragment; Getter for page's content model
Repo at 63ed011: Drop = and }} for final parameter; tests for splitWeightByKeys; A few missing morebits.string tests
Line 1,164:
 
/**
* Gives an array of substrings of `str` - starting with `start` and
* ending with `end`, - which is not in `skiplist`. Intended for use
* on wikitext with templates or links.
*
* @param {string} str
Line 1,173 ⟶ 1,174:
* @returns {string[]}
* @throws If the `start` and `end` strings aren't of the same length.
* @throws If `skiplist` isn't an array or string
*/
splitWeightedByKeys: function(str, start, end, skiplist) {
Line 1,217 ⟶ 1,219:
 
/**
* Formats freeform "reason" (from a textarea) for deletion/other templates
* templates that are going to be substituted, (e.g. PROD, XFD, RPP).
* Handles `|` outside a nowiki tag.
*
* @param {string} str
Line 1,232 ⟶ 1,235:
 
/**
* Formats a "reason" (from a textarea) for inclusion in a userspace log.
* log. Replaces newlines with {{Pb}}, and adds an extra `#` before
* list items for proper formatting.
*
* @param {string} str
Line 4,289 ⟶ 4,294:
if (equals !== -1) {
key = current.substring(0, equals).trim();
value = current.substring(equals + 1, current.length - 2).trim();
result.parameters[key] = value;
equals = -1;