function slugifyLikeGitHub()

in www/static/js/docs.js [45:66]


    function slugifyLikeGitHub(originalText) {

        var text = originalText;

        // convert to lowercase
        text = text.toLowerCase();

        // replace spaces with dashes
        text = text.replace(/ /g, '-');

        // remove unaccepted characters
        // NOTE:
        //      a better regex would have been /[^\d\s\w-_]/ug, but the 'u' flag
        //      (Unicode) is not supported in some browsers, and we support
        //      many languages that use Unicode characters
        text = text.replace(/[\[\]\(\)\;\:\=\+\?\!\.\,\{\}\\\/\>\<]/g, '');

        // trim remaining whitespace
        text = text.trim();

        return text;
    }