escapeSpecialCharacters = function(str) {
            if (!str || str.constructor !== String) {
                return "";
            }
            return str.replace(/\"/g, "'").replace(/</g, "&lt;").replace(/>/g, "&gt;");
        }
Replace special characters before write to output.

Rules:
 - single quotes is the escape sequence for double-quotes
 - &lt; is the escape sequence for <
 - &gt; is the escape sequence for >

@param {String} message to escape
@return escaped message as {String}