Burocratas, emailconfirmed, Administradores da interface, Administradores (Semantic MediaWiki), Curadores (Semantic MediaWiki), Editores (Semantic MediaWiki), Supressores, Administradores
1 057
edições
Sem resumo de edição |
Sem resumo de edição |
||
);
instanceMains.forEach((instanceMain) => {
function transform(string){
originalString = string;
return originalString.value
// remove consecutive spaces
}
instanceMain
.querySelectorAll('.oo-ui-inputWidget-input')
.forEach((input) => {
const normalizedInput = input;
normalizedInput.value = transform(normalizedInput.value);
▲ .replace(/\n|\s\s+|\t/g, ' ')
});
instanceMain.querySelectorAll('textarea').forEach((textarea) => {
const normalizedInput = textarea;
normalizedInput.value = transform(normalizedInput.value);
▲ // "$a Bar \n$b Baz" > " $a Bar $b Baz"
▲ .replace(/\s*(\$[a-z0-8])\s*/g, ' $1 ')
▲ // "$a Bar\nFoo" > "$a Bar Foo" ou "$a Bar Foo" > "$a Bar Foo"
▲ .replace(/\n|\s\s+|\t/g, ' ')
▲ // replace "|" by "%7C" (Ex.: http://viaf.org/processed/WKP|Q2484404)
▲ .replace('|', '%7C');
});
});
|