From 38717daffeb1bd3c2f15a8f88c11fb530a4dbe5c Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 19 May 2022 22:49:29 +0200 Subject: [PATCH] Add support for text buttons --- src/js/easymde.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/easymde.js b/src/js/easymde.js index 639d27c..31273ed 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -236,7 +236,11 @@ function createToolbarButton(options, enableActions, enableTooltips, shortcuts, el.setAttribute('type', markup); enableTooltips = (enableTooltips == undefined) ? true : enableTooltips; - // Properly hande custom shortcuts + if (options.text) { + el.innerText = options.text; + } + + // Properly handle custom shortcuts if (options.name && options.name in shortcuts) { bindings[options.name] = options.action; }