Update 'server/lib/tools.js'

This commit is contained in:
dark 2020-09-17 10:11:41 +00:00
parent 87dc416f48
commit 0e580cac12

View file

@ -170,11 +170,11 @@ function _formatTemplateSimple(source, mergeTags, isHTML) {
return ''; return '';
} }
const containsHTML = /<[a-z][\s\S]*>/.test(value); // const containsHTML = /<[a-z][\s\S]*>/.test(value);
return isHTML ? (containsHTML ? value : value.replace(/(?:\r\n|\r|\n)/g, '<br/>'), { // return isHTML ? (containsHTML ? value : value.replace(/(?:\r\n|\r|\n)/g, '<br/>'), {
useNamedReferences: true, // useNamedReferences: true,
allowUnsafeSymbols: true // allowUnsafeSymbols: true
}) : (containsHTML ? htmlToText.fromString(value) : value); // }) : (containsHTML ? htmlToText.fromString(value) : value);
}; };
return source.replace(/\[([a-z0-9_.]+)(?:\/([^\]]+))?\]/ig, (match, identifier, fallback) => { return source.replace(/\[([a-z0-9_.]+)(?:\/([^\]]+))?\]/ig, (match, identifier, fallback) => {