Various fixes in RSS campaigns including #916 and #915.

This commit is contained in:
Tomas Bures 2020-07-24 12:08:40 +02:00
parent 564c83720b
commit ca615a86a5
6 changed files with 119 additions and 103 deletions

View file

@ -166,6 +166,10 @@ function _formatTemplateSimple(source, mergeTags, isHTML) {
}
}
if (value === undefined) { // in RSS it may happen that the key is present, but the value is undefined
return '';
}
const containsHTML = /<[a-z][\s\S]*>/.test(value);
return isHTML ? he.encode((containsHTML ? value : value.replace(/(?:\r\n|\r|\n)/g, '<br/>')), {
useNamedReferences: true,