This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2018-05-10 04:04:55 -07:00
|
|
|
export const unescapeHTML = (html) => {
|
|
|
|
const wrapper = document.createElement('div');
|
2018-06-15 12:31:08 -07:00
|
|
|
wrapper.innerHTML = html.replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n').replace(/<[^>]*>/g, '');
|
2018-05-10 04:04:55 -07:00
|
|
|
return wrapper.textContent;
|
|
|
|
};
|