mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-04 22:14:34 +00:00
26c20a4ec7
Port c75493755f
to glitch-soc
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;
|
|
};
|