Browse Source

Fixed shortcut code so links are opened as well.

master^2
Jeroen Akkerman 1 month ago
parent
commit
cc0c211759
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      src/js/easymde.js

+ 7
- 1
src/js/easymde.js View File

@@ -1561,7 +1561,12 @@ EasyMDE.prototype.render = function (el) {
1561 1561
         if (options.shortcuts[key] !== null && bindings[key] !== null) {
1562 1562
             (function (key) {
1563 1563
                 keyMaps[fixShortcut(options.shortcuts[key])] = function () {
1564
-                    bindings[key](self);
1564
+                    var action = bindings[key];
1565
+                    if (typeof action === 'function') {
1566
+                        action(self);
1567
+                    } else if (typeof action === 'string') {
1568
+                        window.open(action, '_blank');
1569
+                    }
1565 1570
                 };
1566 1571
             })(key);
1567 1572
         }
@@ -2130,6 +2135,7 @@ EasyMDE.prototype.isPreviewActive = function () {
2130 2135
     return /editor-preview-active/.test(preview.className);
2131 2136
 };
2132 2137
 
2138
+
2133 2139
 EasyMDE.prototype.isSideBySideActive = function () {
2134 2140
     var cm = this.codemirror;
2135 2141
     var wrapper = cm.getWrapperElement();

Loading…
Cancel
Save