@samhammer/tiptob 2.3.28 → 2.3.29

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.
@@ -5042,14 +5042,18 @@ function Eu(e, t) {
5042
5042
  });
5043
5043
  });
5044
5044
  function a() {
5045
- const h = T(i).includes(":") ? T(i) : `https://${T(i)}`, { from: g, empty: b } = n().state.selection;
5046
- b ? n().chain().focus().insertContentAt(g, [
5045
+ const h = T(i).includes(":") ? T(i) : `https://${T(i)}`, { empty: g, from: b } = n().state.selection;
5046
+ if (n().isActive("link")) {
5047
+ n().chain().focus().extendMarkRange("link").setLink({ href: h }).run(), S(o, !1);
5048
+ return;
5049
+ }
5050
+ g ? n().chain().focus().unsetLink().insertContentAt(b, [
5047
5051
  {
5048
5052
  type: "text",
5049
5053
  text: h,
5050
5054
  marks: [{ type: "link", attrs: { href: h } }]
5051
5055
  }
5052
- ]).run() : n().chain().focus().extendMarkRange("link").setLink({ href: h }).run(), S(o, !1);
5056
+ ]).run() : n().chain().focus().setLink({ href: h }).run(), S(o, !1);
5053
5057
  }
5054
5058
  function u() {
5055
5059
  n().chain().focus().extendMarkRange("link").unsetLink().run(), S(i, "");