Skip to content

Commit 0840d53

Browse files
authored
avoid instanceof Node (#1447)
1 parent 4af1703 commit 0840d53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ export function plot(options = {}) {
296296
figure.appendChild(svg);
297297
if (caption != null) {
298298
const figcaption = document.createElement("figcaption");
299-
figcaption.appendChild(caption instanceof Node ? caption : document.createTextNode(caption));
299+
figcaption.appendChild(caption?.ownerDocument ? caption : document.createTextNode(caption));
300300
figure.appendChild(figcaption);
301301
}
302302
}

0 commit comments

Comments
 (0)