Thibaut Girka f6ec8c4821 [Glitch] Use plaintext value for field value tooltips in web UI
Port d185f3ddafc941e280de7efc6d448449ab5ce2c9 to glitch-soc

This doesn't change anything for glitch-style fields, but those will go
away eventually
2018-05-10 14:11:23 +02:00

7 lines
198 B
JavaScript

export const unescapeHTML = (html) => {
const wrapper = document.createElement('div');
html = html.replace(/<br \/>|<br>|\n/g, ' ');
wrapper.innerHTML = html;
return wrapper.textContent;
};