From de1f32bd1fae2cdd7797ba291d70e6d2a02d5213 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 23 Mar 2020 18:18:04 +0100 Subject: [PATCH] Fix icon class handling if no custom icon classes are provided --- src/js/easymde.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/js/easymde.js b/src/js/easymde.js index 6c8200b..d64a52f 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -168,13 +168,12 @@ function createToolbarButton(options, enableActions, enableTooltips, shortcuts, } // Prevent errors if there is no class name in custom options - var className = ''; + var classNameParts = []; if(typeof options.className !== 'undefined') { - className = options.className; + classNameParts = options.className.split(' '); } // Provide backwards compatibility with simple-markdown-editor by adding custom classes to the button. - var classNameParts = className.split(' '); var iconClasses = []; for (var classNameIndex = 0; classNameIndex < classNameParts.length; classNameIndex++) { var classNamePart = classNameParts[classNameIndex];