User:ʤ/common.js

var body = document.querySelector('#pageContainer') if (body) traverse(body)

function traverse(node) { if (node.nodeType === 3) { node.textContent = node.textContent .replace(/\s+([;:,!?])/g, '$1') .replace(/(^|\s+)"/g, '$1“')			.replace(/(\W)"(?=\w)/g, '$1“') .replace(/"/g, '”')			.replace(/(^|\s+)'/g, '$1‘')			.replace(/(\W)'(?=\w)/g, '$1‘')			.replace(/'/g, '’')		return	}	if (node.nodeType !== 1) return	for (var i = node.childNodes.length; i--;) {		traverse(node.childNodes[i]);	} }