mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-24 15:08:06 +01:00
c75493755f
Fix #7748
5 lines
232 B
JavaScript
5 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;
|
|
};
|