How to use the ejs.escapeXML function in ejs

To help you get started, we’ve selected a few ejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HttpErrorPages / HttpErrorPages / lib / page-renderer.js View on Github external
escape: function(text){
            if (!text){
                return '';
            }

            // apply generic escape function
            text = _ejs.escapeXML(text);

            // linebreaks
            text = text.replace(/\n/g, '<br>');

            return text;
        }
    });
github pagarme / node-boleto / lib / formatters.js View on Github external
exports.htmlString = function (str) {
  return str ? escapeXML(str).replace(/\n/g, '<br>') : str
}