瀏覽代碼

Improve link shortening

Zed 6 年之前
父節點
當前提交
2b7b374708
共有 1 個文件被更改,包括 1 次插入1 次删除
  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] & "…"