diff options
-rw-r--r-- | ext/js/display/sandbox/structured-content-generator.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/js/display/sandbox/structured-content-generator.js b/ext/js/display/sandbox/structured-content-generator.js index 5b11965a..0e287dc2 100644 --- a/ext/js/display/sandbox/structured-content-generator.js +++ b/ext/js/display/sandbox/structured-content-generator.js @@ -166,7 +166,11 @@ class StructuredContentGenerator { key = `${key[0].toUpperCase()}${key.substring(1)}`; } key = `sc${key}`; - element.dataset[key] = value; + try { + element.dataset[key] = value; + } catch (e) { + // DOMException if key is malformed + } } } |