aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorFeuerfuchs <git@feuerfuchs.dev>2019-06-26 20:44:36 +0200
committerFeuerfuchs <git@feuerfuchs.dev>2019-06-26 20:44:36 +0200
commitab9a2247e000c0894f2a1d74527f4126b07310ca (patch)
treecf1debb231a1c169060d43e7e1857738052bcd1c /js
parentImproved mobile layout (diff)
downloadgopherproxy-ab9a2247e000c0894f2a1d74527f4126b07310ca.tar.gz
gopherproxy-ab9a2247e000c0894f2a1d74527f4126b07310ca.tar.bz2
gopherproxy-ab9a2247e000c0894f2a1d74527f4126b07310ca.zip
Fix URL/mail regex for newer TLDs (.space etc)
Diffstat (limited to 'js')
-rw-r--r--js/main.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/js/main.ts b/js/main.ts
index 765aa25..12f92ab 100644
--- a/js/main.ts
+++ b/js/main.ts
@@ -254,8 +254,8 @@ function generateMarkupForPlainLinks() {
254 } 254 }
255 255
256 const contentEl = document.getElementsByClassName('content')[0]; 256 const contentEl = document.getElementsByClassName('content')[0];
257 const urlRegex = /\b([a-z]*:\/\/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b[-a-zA-Z0-9@:%_\+.~#?&//=]*)\b/g; 257 const urlRegex = /\b([a-z]*:\/\/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,}\b[-a-zA-Z0-9@:%_\+.~#?&//=]*)\b/g;
258 const mailRegex = /\bmailto:[-a-zA-Z0-9@:%._\+~#=]+@(?:[-a-zA-Z0-9@:%._\+~#=]+\.)+[a-z]{2,4}\b/g; 258 const mailRegex = /\bmailto:[-a-zA-Z0-9@:%._\+~#=]+@(?:[-a-zA-Z0-9@:%._\+~#=]+\.)+[a-z]{2,}\b/g;
259 259
260 contentEl.innerHTML = contentEl.innerHTML.replace(urlRegex, match => { 260 contentEl.innerHTML = contentEl.innerHTML.replace(urlRegex, match => {
261 let href: string = match; 261 let href: string = match;