User:Waldyrious/formatcitations

This script adds two tabs to the mediawiki interface, which trigger a script that performs automatic harmonization of whitespace in citation templates (cite web, etc.).

Each tab implements one of the supported behaviors: regular (tab labeled " – ") and vertical (tab labeled " – +"). Below is an example output for each:
 * Regular mode (adds spaces before and after equal signs, and before the pipe characters):
 * Vertical mode (automatically aligns the equal signs depending on the longest parameter):

Note that neither replacement produces any visible change in the rendered output of the page. The objective is solely to make the wikicode cleaner and easier to read and edit.

Installation
Add the following code to your common.js page: