ragadjust.min.js
1.22 KB
ragadjust = function (e, n) {
if (document.querySelectorAll)for (var i = document.querySelectorAll(e), o = i.length, r = /(\s|^|>)((aboard|about|above|across|after|against|along|amid|among|anti|around|before|behind|below|beneath|beside|besides|between|beyond|concerning|considering|despite|down|during|except|excepting|excluding|following|from|inside|into|like|minus|near|onto|opposite|outside|over|past|plus|regarding|round|save|since|than|that|this|through|toward|towards|under|underneath|unlike|until|upon|versus|with|within|without)?\s)+/gi, t = /(\s|^)(([a-zA-Z-_(]{1,2}('|’)*[a-zA-Z-_,;]{0,1}?\s)+)/gi, a = /([-–—])\s/gi, s = /(<(strong|em|b|i)>)(([^\s]+\s*){2,3})?(<\/(strong|em|b|i)>)/gi; o-- > 0;) {
var l = i[o], u = l.innerHTML;
("prepositions" == n || "all" == n) && (u = u.replace(r, function (e, n, i) {
return n + i
})), ("small-words" == n || "all" == n) && (u = u.replace(t, function (e, n, i) {
return n + i
})), ("dashes" == n || "all" == n) && (u = u.replace(a, function (e) {
return e
})), ("emphasis" == n || "all" == n) && (u = u.replace(s, function (e, n, i, o, r, t) {
return n + o + t
})), l.innerHTML = u
}
};