mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
parent
a666c4867c
commit
0bb0b7e78c
4 changed files with 28 additions and 2 deletions
|
|
@ -33,10 +33,13 @@ proc getUrlPrefix*(cfg: Config): string =
|
|||
if cfg.useHttps: https & cfg.hostname
|
||||
else: "http://" & cfg.hostname
|
||||
|
||||
proc shortLink*(text: string; length=28): string =
|
||||
result = text.replace(wwwRegex, "")
|
||||
proc shorten*(text: string; length=28): string =
|
||||
result = text
|
||||
if result.len > length:
|
||||
result = result[0 ..< length] & "…"
|
||||
|
||||
proc shortLink*(text: string; length=28): string =
|
||||
result = text.replace(wwwRegex, "").shorten(length)
|
||||
|
||||
proc stripHtml*(text: string; shorten=false): string =
|
||||
var html = parseHtml(text)
|
||||
|
|
|
|||
Loading…
Reference in a new issue