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:

((cite web |url = http://example.com |title = Example |author = John Doe |date = 1 January 2000 ))

((cite web
  | url    = http://example.com
  | title  = Example
  | author = John Doe
  | date   = 1 January 2000
  ))

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: ((subst:iusc|1=User:Waldyrious/formatcitations.js))