Support grok_share card

Fixes #1306
This commit is contained in:
Zed
2025-11-17 06:32:13 +01:00
parent a666c4867c
commit 0bb0b7e78c
4 changed files with 28 additions and 2 deletions

View File

@@ -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)