Browse Source

fix curly-braces in template

main
Colin McMillen 1 year ago
parent
commit
09dd5db5b8
  1. 16
      template.html

16
template.html

@ -23,7 +23,7 @@
</head>
<script>
function fixEmails() {
function fixEmails() {{
const mailtoArray = [
'm', 'a', 'i', 'l', 't', 'o', ':',
'c', 'o', 'l', 'i', 'n', '@',
@ -31,16 +31,16 @@ function fixEmails() {
'.', 'd', 'e', 'v'];
const mailtoLink = mailtoArray.join('');
const anchors = document.getElementsByTagName('a');
for (let i = 0; i < anchors.length; i++) {
for (let i = 0; i < anchors.length; i++) {{
const anchor = anchors[i];
if (anchor.href == 'mailto:email@example.com') {
if (anchor.href == 'mailto:email@example.com') {{
anchor.href = mailtoLink;
if (anchor.innerText == 'colin at mcmillen dot dev') {
if (anchor.innerText == 'colin at mcmillen dot dev') {{
anchor.innerText = mailtoLink.substring(7);
}
}
}
}
}}
}}
}}
}}
</script>
<body onload="fixEmails()">

Loading…
Cancel
Save