Added: replace Mandrill (Mailchimp) tracking links with normal links

This commit is contained in:
the-djmaze 2022-10-01 10:00:04 +02:00
parent 69ae65b4bb
commit 55bf83e02a

View file

@ -22,6 +22,16 @@ const
.replace(/^.+awstrack\.me\/.+(https:%2F%2F[^/]+)/gsi, (...m) => decodeURIComponent(m[1]))
.replace(/([?&])utm_[a-z]+=[^&?#]*/gsi, '$1') // Urchin Tracking Module
.replace(/([?&])ec_[a-z]+=[^&?#]*/gsi, '$1') // Sitecore
.replace(/^.+mandrillapp.com.+\?p=([a-z0-9]+)/gsi, (...m) => {
let d = JSON.parse(atob(m[1]));
if (d && d.p) {
d = JSON.parse(d.p);
if (d && d.url) {
return d.url;
}
}
return m[0];
})
.replace(/&&+/, '');
export const