Ich bemerkte, dass GitHub eine js anfügt, die scheint scheint Links zu E-Mail-Adressen zu entfernen, wenn sie die Zeichenfolge /cdn-cgi/l/email-protection
mit ihnen haben. Hat jemand sonst dieses seltsame Problem oder ist das überhaupt von GitHub?Warum hängt GitHub eine js an meine jekyll Seite
Hier ist die prettified Version dieses Skripts:
(function() {
try {
var s, a, i, j, r, c, l = document.getElementsByTagName("a"),
t = document.createElement("textarea");
for (i = 0; l.length - i; i++) {
try {
a = l[i].getAttribute("href");
if (a && a.indexOf("/cdn-cgi/l/email-protection") > -1 && (a.length > 28)) {
s = '';
j = 27 + 1 + a.indexOf("/cdn-cgi/l/email-protection");
if (a.length > j) {
r = parseInt(a.substr(j, 2), 16);
for (j += 2; a.length > j && a.substr(j, 1) != 'X'; j += 2) {
c = parseInt(a.substr(j, 2), 16)^r;
s += String.fromCharCode(c);
}
j += 1;
s += a.substr(j, a.length - j);
}
t.innerHTML = s.replace(/</g, "<").replace(/>/g, ">");
l[i].setAttribute("href", "mailto:" + t.value);
}
} catch (e) {}
}
} catch (e) {}
})();
Wenn ich einen Link wie <a href="mailto:/cdn-cgi/l/email-protection/[email protected]">Contact</a>
haben wird es <a href="mailto:">Contact</a>
. Ansonsten tut es nichts. Trotzdem stört mich das, weil ich das Skript noch nicht dort hingelegt habe, und es scheint, dass ich keine Warnung über GH-Anhänge-Skripte bekomme.