Merge branch 'rt-mrf-md' into 'develop'
Fix RT spacing in the other place See merge request soapbox-pub/soapbox-fe!1014
This commit is contained in:
commit
dada0f7d73
|
@ -1,7 +1,7 @@
|
||||||
// NB: This function can still return unsafe HTML
|
// NB: This function can still return unsafe HTML
|
||||||
export const unescapeHTML = (html) => {
|
export const unescapeHTML = (html) => {
|
||||||
const wrapper = document.createElement('div');
|
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;
|
return wrapper.textContent;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue