Add apostrophe handling to n in saynul and stoi

This commit is contained in:
kleph 2021-01-31 13:45:07 +01:00
parent 29a139f858
commit e0727a2249
2 changed files with 16 additions and 6 deletions

View file

@ -31,9 +31,14 @@
var s_hostname = punycode.toUnicode(location.host) var s_hostname = punycode.toUnicode(location.host)
var s_txt = s_hostname.replace("." + s_base_domain, s_replace); var s_txt = s_hostname.replace("." + s_base_domain, s_replace);
var apostrophe = s_txt.match(/\.(l)\.|^(l)\./); var apostrophe = s_txt.match(/\.(l)\.|^(l)\./);
var napostrophe = s_txt.match(/\.(n)\.|^(n)\./);
if (apostrophe){ if (apostrophe){
s_txt = s_txt.replace(/l\./, "l'"); 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.replace(/\./g, " ");
s_txt = s_txt.charAt(0).toUpperCase() + s_txt.slice(1); s_txt = s_txt.charAt(0).toUpperCase() + s_txt.slice(1);

View file

@ -31,10 +31,15 @@
var s_hostname = punycode.toUnicode(location.host) var s_hostname = punycode.toUnicode(location.host)
var s_txt = s_hostname.replace("." + s_base_domain, ""); var s_txt = s_hostname.replace("." + s_base_domain, "");
var apostrophe = s_txt.match(/\.(l)\.|^(l)\./); var apostrophe = s_txt.match(/\.(l)\.|^(l)\./);
var napostrophe = s_txt.match(/\.(n)\.|^(n)\./);
if (apostrophe){ if (apostrophe){
s_txt = s_txt.replace(/l\./, "l'"); 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.replace(/\./g, " ");
s_txt = s_replace + s_txt + "." s_txt = s_replace + s_txt + "."