mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
6 lines
232 B
JavaScript
6 lines
232 B
JavaScript
export const unescapeHTML = (html) => {
|
|
const wrapper = document.createElement('div');
|
|
wrapper.innerHTML = html.replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n').replace(/<[^>]*>/g, '');
|
|
return wrapper.textContent;
|
|
};
|