Skip to content

Instantly share code, notes, and snippets.

@grejppi
Last active August 29, 2015 14:14
Show Gist options
  • Save grejppi/c1e97f19e4480b625578 to your computer and use it in GitHub Desktop.
Save grejppi/c1e97f19e4480b625578 to your computer and use it in GitHub Desktop.
ses everything
// ==UserScript==
// @name ses everything
// @namespace https://gist.github.com/grejppi/c1e97f19e4480b625578
// @include *
// @version 1
// @grant none
// ==/UserScript==
function ses(s) {
var e = s.match(/([Ss][AEIOUYÄÖaeiouyäö])/g);
return null === e ? ' ' : (e.forEach(function (s, e, n) {
n[e] = s.substr(0, 2) + s.substr(0, 1)
}), e.join(' ') + ' ')
}
function sis(s) {
if (s = s || document.body, 3 == s.nodeType) s.nodeValue = ses(s.nodeValue);
else {
var e = s.childNodes;
if (e) for (var n = e.length; n--; ) sis(e[n])
}
}
sis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment