mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 09:02:45 +08:00
Bugfix: strip utm_ tracking failed
This commit is contained in:
parent
75766573e9
commit
121f6f0bf8
1 changed files with 2 additions and 2 deletions
|
@ -16,7 +16,7 @@ const
|
|||
replaceWithChildren = node => node.replaceWith(...[...node.childNodes]),
|
||||
|
||||
// Strip utm_* tracking
|
||||
stripTracking = text => text.replace(/(\?|&|&)utm_[a-z]+=[^&?#]*/si, '$1');
|
||||
stripTracking = text => text.replace(/([?&])utm_[a-z]+=[^&?#]*/gsi, '$1').replace(/&&+/, '');
|
||||
|
||||
export const
|
||||
|
||||
|
@ -184,11 +184,11 @@ export const
|
|||
|
||||
else if ('A' === name) {
|
||||
value = oElement.href;
|
||||
value = stripTracking(value);
|
||||
if (!/^([a-z]+):/i.test(value)) {
|
||||
setAttribute('data-x-broken-href', value);
|
||||
delAttribute('href');
|
||||
} else {
|
||||
oElement.href = stripTracking(value);
|
||||
setAttribute('target', '_blank');
|
||||
setAttribute('rel', 'external nofollow noopener noreferrer');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue