2018-05-07 07:30:38 +00:00
|
|
|
export const unescapeHTML = (html) => {
|
|
|
|
const wrapper = document.createElement('div');
|
2018-06-06 18:49:53 +00:00
|
|
|
wrapper.innerHTML = html.replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n').replace(/<[^>]*>/g, '');
|
2018-05-07 07:30:38 +00:00
|
|
|
return wrapper.textContent;
|
|
|
|
};
|