mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Ensure correct text formatting
This commit is contained in:
parent
0fee70eeba
commit
aae0e51154
7 changed files with 33 additions and 22 deletions
|
|
@ -42,6 +42,17 @@ proc emojify*(node: XmlNode) =
|
|||
for i in node.querySelectorAll(".Emoji"):
|
||||
i.add newText(i.getAttr("alt"))
|
||||
|
||||
proc getQuoteText*(tweet: XmlNode): string =
|
||||
let
|
||||
text = tweet.querySelector(".QuoteTweet-text")
|
||||
hasEmojis = not text.querySelector(".Emoji").isNil
|
||||
|
||||
if hasEmojis:
|
||||
emojify(text)
|
||||
|
||||
result = stripText(selectText(text, ".tweet-text"))
|
||||
result = stripTwitterUrls(result)
|
||||
|
||||
proc getTweetText*(tweet: XmlNode): string =
|
||||
let
|
||||
selector = ".tweet-text > a.twitter-timeline-link.u-hidden"
|
||||
|
|
|
|||
Loading…
Reference in a new issue