Fix whitespace and comment discrepancies

This commit is contained in:
Claire
2023-11-15 12:40:52 +01:00
parent 08ac91c40b
commit b1f0457cb8
5 changed files with 9 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
// NB: This function can still return unsafe HTML
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, '');