« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static/js/client-util.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/static/js/client-util.js')
-rw-r--r--src/static/js/client-util.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/static/js/client-util.js b/src/static/js/client-util.js
index 74d63ad6..0c113758 100644
--- a/src/static/js/client-util.js
+++ b/src/static/js/client-util.js
@@ -65,6 +65,14 @@ export function templateContent(el, slots = {}) {
   return content;
 }
 
+export function decodeEntities(string) {
+  if (!string) return string;
+
+  const textarea = document.createElement('textarea');
+  textarea.innerHTML = string;
+  return textarea.value;
+}
+
 // Curry-style, so multiple points can more conveniently be tested at once.
 export function pointIsOverAnyOf(elements) {
   return (clientX, clientY) => {