From eb87c4c86d7598ba6db97f3d2ff8235d8bd68fff Mon Sep 17 00:00:00 2001 From: Daniel Bulant Date: Sun, 19 Dec 2021 11:01:36 +0100 Subject: [PATCH] fix: search not working with links --- src/pages/index.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/index.svelte b/src/pages/index.svelte index 0f0497c..6f8e2f8 100644 --- a/src/pages/index.svelte +++ b/src/pages/index.svelte @@ -86,8 +86,9 @@ function open() { var id = name; - if(name.startsWith("https://mangadex.org/title")) { - id = name.substr("https://mangadex.org/title".length); + if(name.startsWith("https://mangadex.org/title/")) { + id = name.substr("https://mangadex.org/title/".length); + id = id.split("/")[0]; } else if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(name)) { return alert("You provided invalid ID or link. Make sure you copy the full URL from mangadex.org title page"); }