Current File : //usr/lib/node_modules/bower/lib/node_modules/mout/src/string/escapeHtml.js
define(['../lang/toString'], function(toString) {

    /**
     * Escapes a string for insertion into HTML.
     */
    function escapeHtml(str){
        str = toString(str)
            .replace(/&/g, '&')
            .replace(/</g, '&lt;')
            .replace(/>/g, '&gt;')
            .replace(/'/g, '&#39;')
            .replace(/"/g, '&quot;');
        return str;
    }

    return escapeHtml;

});