Explorar o código

Improve link shortening

Zed %!s(int64=6) %!d(string=hai) anos
pai
achega
2b7b374708
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/formatters.nim

+ 1 - 1
src/formatters.nim

@@ -23,7 +23,7 @@ proc stripHtml*(text: string): string =
   html.innerText()
 
 proc shortLink*(text: string; length=28): string =
-  result = text.replace(re"https?://(www.)?", "")
+  result = text.replace(re"https?://(www[0-9]?\.)?", "")
   if result.len > length:
     result = result[0 ..< length] & "…"