sforkowany z mirror/soapbox
Merge branch 'rt-mrf-md' into 'develop'
Fix RT spacing in the other place See merge request soapbox-pub/soapbox-fe!1014improve-ci
commit
dada0f7d73
|
@ -1,7 +1,7 @@
|
|||
// 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, '');
|
||||
wrapper.innerHTML = html.replace(/<br\s*\/?>/g, '\n').replace(/<\/p><[^>]*>/g, '\n\n').replace(/<[^>]*>/g, '');
|
||||
return wrapper.textContent;
|
||||
};
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue