function decodeHTMLEntities (str) { if (str && typeof str === 'string') { // strip script/html tags var element = document.querySelector('.editor') str = str.replace(/