Content deleted Content added
PleaseStand (talk | contribs) m sync with https://en.wikipedia.org/w/index.php?title=User:PleaseStand/segregate-refs.js&oldid=789977219: "disable all wikitext parsing, to avoid error categories due to 'broken' <ref" by User:TheDJ |
PleaseStand (talk | contribs) fix the __proto__ bug |
||
Line 56:
var editForm, refsDiv, refsH2, mainTextbox, refsTextbox, randPrefix, messages,
refsButton, convertButton, unloadHandlerRegistered = false;
/**
Line 132 ⟶ 128:
return null;
}
var attributes =
while ( ( results = attParseRegex.exec( this.parsedRef[1] ) ) ) {
attributes[results[1].toLowerCase()] = htmlUnquote( results[2] );
Line 150 ⟶ 146:
var prefixChars, randNo, randPrefix, refPreferred, scanner, ref, parser, attributes,
refGroup, refName, refStored, refEmpty, refLong, unnamedRefs = 0,
refNames =
// Create a random prefix for autogenerated ref names
Line 178 ⟶ 174:
// The ref already has a name (possibly the empty string)
refName = attributes.name;
refStored =
refEmpty = parser.parsedRef[2].slice( -2 ) == '/>' ||
parser.parsedRef[2].slice( 0, 3 ) == '></';
Line 259 ⟶ 255:
}
var scanner, ref, parser, attributes, refCodes =
preferredRef =
// First, we build an associative array of all the ref codes
Line 270 ⟶ 266:
if ( attributes.name !== undefined ) {
// Only use the first ref having each name
if ( !
refCodes[attributes.name] = ref;
}
Line 284 ⟶ 280:
attributes = parser.getAttributes();
if ( attributes.name !== undefined ) {
if ( !
usageFreq[attributes.name] = 1;
} else {
Line 302 ⟶ 298:
parser = new RefParser( ref );
attributes = parser.getAttributes();
if (
// Is this name on the replacement list?
if (
// If we are using caseCues, and another ___location is
// preferred, skip to the next ref.
if ( caseCues &&
ref.slice( 0, 4 ) != '<REF'
) {
Line 378 ⟶ 374:
// Find all unused ref names
for(refName in result.unusedRefs) {
▲ unusedRefNamesQuoted.push(htmlQuote(refName));
}
// If any refs are unused, warn and allow the user to cancel;
|