From 565c42e0ff298a7562cd7406191bfabb44a558b8 Mon Sep 17 00:00:00 2001 From: Jeroen Akkerman Date: Tue, 11 Jan 2022 21:28:22 +0100 Subject: [PATCH] Add hasOwnProperty check --- src/js/easymde.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/easymde.js b/src/js/easymde.js index ccc04a0..f4a0c70 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -239,7 +239,9 @@ function createToolbarButton(options, enableActions, enableTooltips, shortcuts, if (options.attributes) { for (var attribute in options.attributes) { - el.setAttribute(attribute, options.attributes[attribute]); + if (Object.prototype.hasOwnProperty.call(options.attributes, attribute)) { + el.setAttribute(attribute, options.attributes[attribute]); + } } }