diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-02-12 18:11:24 -0400 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-02-12 18:11:24 -0400 |
| commit | 41ea9c2d570c93ae9c290ecda20732399ffdc36b (patch) | |
| tree | 8b684b947bd8ce87a38014f44005e5e25d5d7182 /src/static/js/client-util.js | |
| parent | 4e49f28f75a5ae280c1b32f7109e4911da439905 (diff) | |
client: sidebar-search: handle HTML entities
Diffstat (limited to 'src/static/js/client-util.js')
| -rw-r--r-- | src/static/js/client-util.js | 8 |
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) => { |