This repository has been archived on 2022-09-21. You can view files and clone it, but cannot push or open issues or pull requests.
|
import xss from 'xss/dist/xss';
|
|
|
|
const element = document.createElement('div');
|
|
|
|
export function decodeHTMLEntities (str) {
|
|
if (str && typeof str === 'string') {
|
|
element.innerHTML = xss.filterXSS(str);
|
|
str = element.textContent;
|
|
element.textContent = '';
|
|
}
|
|
return str;
|
|
}
|