Here you can find the source of sanitizeSpacing()
"use strict";//w ww.j a v a 2 s. c o m /** Custom string functions to help with term extraction */ String.prototype.sanitizeSpacing = function () { return this .replace(/[\t\r\n\-]/g, ' ') // Newline/tab to single space .replace(/ +/g, ' ') // Multiple 'spaces' to single .trim(); // Trim (spaces from new lines etc) };
String.prototype.sanitize = function() { return $('<div/>').text(this).html(); };
String.prototype.sanitize = function(){ return this.replace(/</g, '<').replace(/>/g, '>');
String.prototype.sanitize = function() { return this .replace(/&/g, '&') .replace(/</g, '<') .replace(/>/g, '>') .replace(/"/g, '"') .replace(/'/g, ''')
String.prototype.sanitize = function () { var str = this.replace(/<[^>]*?>/g, ''); return str; };
String.prototype.sanitizeToId = function () { return this.replace(/\]/g, '').replace(/[^-a-zA-Z0-9:.]/g, '_'); };