From cc0c211759b9af5c1339ed39d4e8496f817b8d2c Mon Sep 17 00:00:00 2001 From: Jeroen Akkerman Date: Mon, 15 Apr 2019 15:20:48 +0200 Subject: [PATCH 1/2] Fixed shortcut code so links are opened as well. --- src/js/easymde.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/js/easymde.js b/src/js/easymde.js index 9f7b074..fcfa951 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -1561,7 +1561,12 @@ EasyMDE.prototype.render = function (el) { if (options.shortcuts[key] !== null && bindings[key] !== null) { (function (key) { keyMaps[fixShortcut(options.shortcuts[key])] = function () { - bindings[key](self); + var action = bindings[key]; + if (typeof action === 'function') { + action(self); + } else if (typeof action === 'string') { + window.open(action, '_blank'); + } }; })(key); } @@ -2130,6 +2135,7 @@ EasyMDE.prototype.isPreviewActive = function () { return /editor-preview-active/.test(preview.className); }; + EasyMDE.prototype.isSideBySideActive = function () { var cm = this.codemirror; var wrapper = cm.getWrapperElement(); From 8b5806d663471a883d9a81b009d9b9fc4be9a668 Mon Sep 17 00:00:00 2001 From: Jeroen Akkerman Date: Mon, 15 Apr 2019 15:34:05 +0200 Subject: [PATCH 2/2] Updated changelog for PR #75 --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8e521a..d02298d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - +## [Unreleased] +### Fixed +- Keyboard shortcuts for custom actions not working (Thanks to [@ysykzheng], [#75]). + ## [2.6.0] - 2019-04-15 ### Added - Contributing guide (Thanks to [@roipoussiere], [#54]). @@ -107,12 +110,14 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown [#9]: https://github.com/Ionaru/easy-markdown-editor/issues/9 +[#75]: https://github.com/Ionaru/easy-markdown-editor/pull/75 [#54]: https://github.com/Ionaru/easy-markdown-editor/pull/54 [#31]: https://github.com/Ionaru/easy-markdown-editor/pull/31 [#27]: https://github.com/Ionaru/easy-markdown-editor/pull/27 [#19]: https://github.com/Ionaru/easy-markdown-editor/pull/19 +[@ysykzheng]: https://github.com/ysykzheng [@roipoussiere]: https://github.com/roipoussiere [@FranklinWhale]: https://github.com/FranklinWhale [@Furgas]: https://github.com/Furgas