From e0727a2249b9027adc57b51b940607db3cac3c24 Mon Sep 17 00:00:00 2001 From: kleph Date: Sun, 31 Jan 2021 13:45:07 +0100 Subject: [PATCH] Add apostrophe handling to n in saynul and stoi --- saynul.html | 11 ++++++++--- stoi.html | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/saynul.html b/saynul.html index 63afe22..0a425d1 100644 --- a/saynul.html +++ b/saynul.html @@ -31,9 +31,14 @@ var s_hostname = punycode.toUnicode(location.host) var s_txt = s_hostname.replace("." + s_base_domain, s_replace); var apostrophe = s_txt.match(/\.(l)\.|^(l)\./); - if (apostrophe){ - s_txt = s_txt.replace(/l\./, "l'"); - } + var napostrophe = s_txt.match(/\.(n)\.|^(n)\./); + + if (apostrophe){ + s_txt = s_txt.replace(/l\./, "l'"); + } + if (napostrophe){ + s_txt = s_txt.replace(/n\./, "n'"); + } s_txt = s_txt.replace(/\./g, " "); s_txt = s_txt.charAt(0).toUpperCase() + s_txt.slice(1); diff --git a/stoi.html b/stoi.html index 74e43a4..9c084e0 100644 --- a/stoi.html +++ b/stoi.html @@ -31,10 +31,15 @@ var s_hostname = punycode.toUnicode(location.host) var s_txt = s_hostname.replace("." + s_base_domain, ""); var apostrophe = s_txt.match(/\.(l)\.|^(l)\./); + var napostrophe = s_txt.match(/\.(n)\.|^(n)\./); + + if (apostrophe){ + s_txt = s_txt.replace(/l\./, "l'"); + } + if (napostrophe){ + s_txt = s_txt.replace(/n\./, "n'"); + } - if (apostrophe){ - s_txt = s_txt.replace(/l\./, "l'"); - } s_txt = s_txt.replace(/\./g, " "); s_txt = s_replace + s_txt + "."