@fileverse-dev/ddoc 3.4.0 → 3.4.1
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.
- package/dist/index.es.js +4 -3
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -51846,12 +51846,12 @@ const Jp = (e) => {
|
|
|
51846
51846
|
t.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
51847
51847
|
return;
|
|
51848
51848
|
}
|
|
51849
|
-
if (!/^(https?:\/\/)?([\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?|\w+@[\w.-]+\.\w+)
|
|
51849
|
+
if (!/^(https?:\/\/)?([\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?|\w+@[\w.-]+\.\w+)\s*$/i.test(s)) {
|
|
51850
51850
|
i && typeof i == "function" && i("Invalid URL");
|
|
51851
51851
|
return;
|
|
51852
51852
|
}
|
|
51853
51853
|
let c = s;
|
|
51854
|
-
!s.startsWith("http://") && !s.startsWith("https://") && (c = "https://" + s), t.chain().focus().extendMarkRange("link").setLink({ href: c }).run(), n(et.NONE), r && o && o(!1);
|
|
51854
|
+
!s.startsWith("http://") && !s.startsWith("https://") && (c = "https://" + s), c = c.trim(), t.chain().focus().extendMarkRange("link").setLink({ href: c }).run(), n(et.NONE), r && o && o(!1);
|
|
51855
51855
|
const d = D3(c);
|
|
51856
51856
|
d && !d.headingEl && (i == null || i("This heading link belongs to a different document."));
|
|
51857
51857
|
}, [s, t, r, o, i, n]);
|
|
@@ -185283,10 +185283,11 @@ const yGe = { status: "idle" }, xGe = (e) => {
|
|
|
185283
185283
|
return;
|
|
185284
185284
|
}
|
|
185285
185285
|
let w = p;
|
|
185286
|
-
if (w && !w.startsWith("http://") && !w.startsWith("https://") && (w = "https://" + w), w && !/^(https?:\/\/)?([\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?|\w+@[\w.-]+\.\w+)
|
|
185286
|
+
if (w && !w.startsWith("http://") && !w.startsWith("https://") && (w = "https://" + w), w && !/^(https?:\/\/)?([\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?|\w+@[\w.-]+\.\w+)\s*$/i.test(w)) {
|
|
185287
185287
|
F(!1), t && t("Invalid URL");
|
|
185288
185288
|
return;
|
|
185289
185289
|
}
|
|
185290
|
+
w = w.trim();
|
|
185290
185291
|
const { from: C, to: _ } = e.state.selection;
|
|
185291
185292
|
e.state.doc.textBetween(C, _).length > 0 ? e.chain().focus().deleteSelection().insertContent({
|
|
185292
185293
|
type: "text",
|