Ignore DOMExceptions thrown by assigning an invalid dataset property (#2133)
This commit is contained in:
parent
8b6f526dc6
commit
fd75e91e75
@ -166,7 +166,11 @@ class StructuredContentGenerator {
|
|||||||
key = `${key[0].toUpperCase()}${key.substring(1)}`;
|
key = `${key[0].toUpperCase()}${key.substring(1)}`;
|
||||||
}
|
}
|
||||||
key = `sc${key}`;
|
key = `sc${key}`;
|
||||||
element.dataset[key] = value;
|
try {
|
||||||
|
element.dataset[key] = value;
|
||||||
|
} catch (e) {
|
||||||
|
// DOMException if key is malformed
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user