From f6ec8c48210f6bce421d0d7248737d028ae88ee3 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Thu, 10 May 2018 13:04:55 +0200 Subject: [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 --- app/javascript/flavours/glitch/util/html.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 app/javascript/flavours/glitch/util/html.js (limited to 'app/javascript/flavours/glitch/util') diff --git a/app/javascript/flavours/glitch/util/html.js b/app/javascript/flavours/glitch/util/html.js new file mode 100644 index 000000000..0b646ce58 --- /dev/null +++ b/app/javascript/flavours/glitch/util/html.js @@ -0,0 +1,6 @@ +export const unescapeHTML = (html) => { + const wrapper = document.createElement('div'); + html = html.replace(/
|
|\n/g, ' '); + wrapper.innerHTML = html; + return wrapper.textContent; +}; -- cgit