Moved tracking scripts to partial and made tools.formatMessage() less greedy

The change in tools.formatMessage() prevents stripping CSS like
a[data-foo] and arrays in JS. Thus only replacing mergeTag it knows
about.
This commit is contained in:
witzig 2017-03-06 14:39:43 +01:00
parent 1c38a1a7bb
commit a164a7fb40
5 changed files with 41 additions and 49 deletions

View file

@ -186,7 +186,7 @@ function formatMessage(serviceUrl, campaign, list, subscription, message, filter
return message.replace(/\[([a-z0-9_]+)(?:\/([^\]]+))?\]/ig, (match, identifier, fallback) => {
identifier = identifier.toUpperCase();
let value = (getValue(identifier) || fallback || '').trim();
return value ? filter(value) : '';
return value ? filter(value) : match;
});
}