Skip to content

Commit

Permalink
Merge pull request #2 from Huoyuuu/add-idn-support
Browse files Browse the repository at this point in the history
Add support for Internationalized Domain Names (IDNs)
  • Loading branch information
Nicell authored Jun 23, 2023
2 parents 8f3c79f + 90b9d86 commit 58fc14d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import Layout from "../layouts/Layout.astro";
<link rel="preload" href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/toastify-js" defer></script>
<script is:inline>
import punycode from 'punycode';
var bases = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '='];

function longer() {
var website = document.getElementById("website").value;
var strippedURL = website.replace(/^(https?:\/\/)?([^\/]+).*/, "$2");
website = punycode.toASCII(strippedURL);
try {
var urled = new URL(website);
// Make sure the URL is http or https
Expand Down

0 comments on commit 58fc14d

Please sign in to comment.