md-editor-v3 5.7.1 → 5.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const DropdownToolbar = require("./chunks/index2.cjs");
2
+ const DropdownToolbar = require("./chunks/index.cjs");
3
3
  module.exports = DropdownToolbar.DropdownToolbar;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const MdCatalog = require("./chunks/index3.cjs");
2
+ const MdCatalog = require("./chunks/index4.cjs");
3
3
  module.exports = MdCatalog.MdCatalog;
@@ -5,13 +5,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5
5
  const vue = require("vue");
6
6
  const config = require("./chunks/config.cjs");
7
7
  const util = require("@vavt/util");
8
- const DropdownToolbar = require("./chunks/index2.cjs");
8
+ const DropdownToolbar = require("./chunks/index.cjs");
9
9
  const eventName = require("./chunks/event-name.cjs");
10
10
  const dom = require("./chunks/dom.cjs");
11
- const MdPreview = require("./chunks/index.cjs");
12
- const MdModal = require("./chunks/index4.cjs");
11
+ const MdPreview = require("./chunks/index3.cjs");
12
+ const MdModal = require("./chunks/index2.cjs");
13
13
  const index = require("./chunks/index5.cjs");
14
- const MdCatalog = require("./chunks/index3.cjs");
14
+ const MdCatalog = require("./chunks/index4.cjs");
15
15
  const codemirror = require("codemirror");
16
16
  const view = require("@codemirror/view");
17
17
  const languageData = require("@codemirror/language-data");
@@ -1609,6 +1609,7 @@ ${mermaidTemplates[type]}
1609
1609
  const handleImage = (params) => {
1610
1610
  const { desc = "", url = "", urls } = params;
1611
1611
  let text = "";
1612
+ const urlIsEmpty = url === "" && (!urls || urls instanceof Array && urls.length === 0);
1612
1613
  if (urls instanceof Array) {
1613
1614
  text = urls.reduce((pVal, _url) => {
1614
1615
  const {
@@ -1627,8 +1628,8 @@ const handleImage = (params) => {
1627
1628
  text,
1628
1629
  options: {
1629
1630
  select: url === "",
1630
- deviationStart: text.length - url.length - 2,
1631
- deviationEnd: -2
1631
+ deviationStart: urlIsEmpty ? text.length - url.length - 2 : text.length,
1632
+ deviationEnd: urlIsEmpty ? -2 : 0
1632
1633
  }
1633
1634
  };
1634
1635
  };
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const MdModal = require("./chunks/index4.cjs");
2
+ const MdModal = require("./chunks/index2.cjs");
3
3
  module.exports = MdModal.MdModal;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const MdPreview = require("./chunks/index.cjs");
2
+ const MdPreview = require("./chunks/index3.cjs");
3
3
  module.exports = MdPreview.MdPreview;
@@ -2,7 +2,7 @@
2
2
  const vue = require("vue");
3
3
  const config = require("./chunks/config.cjs");
4
4
  const vueTsx = require("./chunks/vue-tsx.cjs");
5
- const MdModal = require("./chunks/index4.cjs");
5
+ const MdModal = require("./chunks/index2.cjs");
6
6
  function _isSlot(s) {
7
7
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
8
8
  }