Vue.filter('removeHtml', input => { return input && input.replace(/<(?:.| )*?>/gm, '') .replace(/(”)/g, '"') .replace(/“/g, '"') .replace(/—/g, '-') .replace(/ /g, '') .replace(/>/g, '>') .replace(/</g, '<') .replace(/<[ws"':=/]*/, ''); });
function escapeHTML(untrusted) { // Escape untrusted input so that it can safely be used in a HTML response // in HTML and in HTML attributes. return untrusted .replace(/&/g, '&') .replace(/</g, '<') .replace(/>/g, '>') .replace(/"/g, '"') .replace(/'/g, '''); }