diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-02-26 18:03:58 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-02-26 18:03:58 -0400 |
commit | 7bf9489f14735f9e44af37f2ade14890a119b403 (patch) | |
tree | 8b7742140ceeeda283edfe05f745d0e1a06050fe /src/util/html.js | |
parent | ae5f68ba51bbbe308cc56e70e70209652c869843 (diff) | |
parent | 8d05431f0c815227ba5cd503e88b0ee531c6eeb8 (diff) |
Merge branch 'preview' into image-overlay
Diffstat (limited to 'src/util/html.js')
-rw-r--r-- | src/util/html.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/html.js b/src/util/html.js index a6b0d621..459a1647 100644 --- a/src/util/html.js +++ b/src/util/html.js @@ -130,6 +130,14 @@ export function attributes(attribs) { throw new Error(`Attribute value for ${key} should be primitive or array, got ${typeof val}`); }) .filter(([_key, _val, keep]) => keep) + .map(([key, val]) => { + switch (key) { + case 'href': + return [key, encodeURI(val)]; + default: + return [key, val]; + } + }) .map(([key, val]) => typeof val === 'boolean' ? `${key}` |