Skip to content

Commit 6f67ea1

Browse files
arddormarcbachmann
authored andcommitted
fix(clipboard): safely access allowedElements
1 parent b9b9677 commit 6f67ea1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/clipboard.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function conditionalNodeWrap (child, content, options) {
125125
// returns string of concatenated attributes e.g. 'target="_blank" rel="nofollow" href="/test.com"'
126126
function filterAttributes (nodeName, node) {
127127
return Array.from(node.attributes).reduce((attributes, {name, value}) => {
128-
if (allowedElements[nodeName][name] && value) {
128+
if (allowedElements[nodeName]?.[name] && value) {
129129
return `${attributes} ${name}="${value}"`
130130
}
131131
return attributes

0 commit comments

Comments
 (0)