Update 'server/lib/tools.js'
Remove HTML entities
This commit is contained in:
parent
8f6e314a3a
commit
87dc416f48
1 changed files with 2 additions and 2 deletions
|
@ -10,7 +10,7 @@ const mjml2html = require('mjml');
|
|||
|
||||
const hbs = require('hbs');
|
||||
const juice = require('juice');
|
||||
const he = require('he');
|
||||
//const he = require('he');
|
||||
const htmlToText = require('html-to-text');
|
||||
|
||||
const fs = require('fs-extra');
|
||||
|
@ -171,7 +171,7 @@ function _formatTemplateSimple(source, mergeTags, isHTML) {
|
|||
}
|
||||
|
||||
const containsHTML = /<[a-z][\s\S]*>/.test(value);
|
||||
return isHTML ? he.encode((containsHTML ? value : value.replace(/(?:\r\n|\r|\n)/g, '<br/>')), {
|
||||
return isHTML ? (containsHTML ? value : value.replace(/(?:\r\n|\r|\n)/g, '<br/>'), {
|
||||
useNamedReferences: true,
|
||||
allowUnsafeSymbols: true
|
||||
}) : (containsHTML ? htmlToText.fromString(value) : value);
|
||||
|
|
Loading…
Reference in a new issue