1
0
mirror of https://github.com/glitch-soc/mastodon.git synced 2025-01-27 18:13:12 -05:00

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;
};