User:Erutuon/scripts/footnoteCleanup.js: Difference between revisions

Content deleted Content added
added more things to escape
documentation; don't add same edit summary twice
Line 1:
/*
Moves refs and citation needed tags after punctuation.
*/
var namespaceNumber = mw.config.values.wgNamespaceNumber;
 
// Add a link just above the edit box, if you're in the main namespace.
if ( namespaceNumber === 0 )
{
Line 34 ⟶ 38:
};
// * Escape ...various things:
// ref tags */
contents = escape(
contents,
Line 75 ⟶ 79:
mw.notify(count + " correction" + ( ( count > 1 && "s" ) || "" ) + " made: " + replacements.join());
// Unescape the various things escaped above.
contents = contents.replace(
/%%(\d+)%%/g,
Line 104 ⟶ 109:
}
if ( !isUnchanged && !afterSectionName.includes(addition) )
{
return summary + addition;