Rename flavours/glitch/util into flavours/glitch/utils
This commit is contained in:
5
app/javascript/flavours/glitch/utils/html.js
Normal file
5
app/javascript/flavours/glitch/utils/html.js
Normal file
@@ -0,0 +1,5 @@
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user