From b1aaffc0e43b4f6fed3532f24d6f0cd572894b5a Mon Sep 17 00:00:00 2001 From: Huoyuuu Date: Tue, 20 Jun 2023 22:38:21 +0800 Subject: [PATCH 1/2] Add support for Internationalized Domain Names (IDNs) --- src/pages/index.astro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/index.astro b/src/pages/index.astro index cbe9539..7425460 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -10,6 +10,8 @@ import Layout from "../layouts/Layout.astro"; function longer() { var website = document.getElementById("website").value; + var strippedURL = website.replace(/^(https?:\/\/)?([^\/]+).*/, "$2"); + var website = punycode.toASCII(strippedURL); try { var urled = new URL(website); // Make sure the URL is http or https From 90b9d866a5cf77ff2cfa9441b1b6273dd71d8128 Mon Sep 17 00:00:00 2001 From: Huoyuuu <86390123+Huoyuuu@users.noreply.github.com> Date: Tue, 20 Jun 2023 23:27:13 +0800 Subject: [PATCH 2/2] Update index.astro --- src/pages/index.astro | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/index.astro b/src/pages/index.astro index 7425460..92a276a 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -6,12 +6,12 @@ import Layout from "../layouts/Layout.astro";