diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-05-10 13:04:55 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2018-05-10 14:11:23 +0200 |
commit | f6ec8c48210f6bce421d0d7248737d028ae88ee3 (patch) | |
tree | 184de738f4084a55c1798321b0b41ff37efe2517 /app/javascript/flavours/glitch/util/html.js | |
parent | 34142ab29c33104793afe3199f102d84b83b9b57 (diff) |
[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
Diffstat (limited to 'app/javascript/flavours/glitch/util/html.js')
-rw-r--r-- | app/javascript/flavours/glitch/util/html.js | 6 |
1 files changed, 6 insertions, 0 deletions
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(/<br \/>|<br>|\n/g, ' '); + wrapper.innerHTML = html; + return wrapper.textContent; +}; |