mirror of
https://github.com/zedeus/nitter.git
synced 2024-12-13 03:26:30 +00:00
Unshortify links when stripping html
This commit is contained in:
parent
73cfc6979f
commit
2a2255d75a
1 changed files with 5 additions and 1 deletions
|
@ -17,7 +17,11 @@ proc stripText*(text: string): string =
|
||||||
text.replace(nbsp, " ").strip()
|
text.replace(nbsp, " ").strip()
|
||||||
|
|
||||||
proc stripHtml*(text: string): string =
|
proc stripHtml*(text: string): string =
|
||||||
let html = parseHtml(text)
|
var html = parseHtml(text)
|
||||||
|
for el in html.findAll("a"):
|
||||||
|
let link = el.attr("href")
|
||||||
|
if "http" in link:
|
||||||
|
el[0].text = link
|
||||||
html.innerText()
|
html.innerText()
|
||||||
|
|
||||||
proc shortLink*(text: string; length=28): string =
|
proc shortLink*(text: string; length=28): string =
|
||||||
|
|
Loading…
Reference in a new issue