From c4d648e952eb45d1ff876df203407347d320c1a7 Mon Sep 17 00:00:00 2001 From: Zed Date: Tue, 25 Jun 2019 06:02:57 +0200 Subject: [PATCH] Always emojify --- src/parserutils.nim | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/parserutils.nim b/src/parserutils.nim index 1f52e48..c2652a0 100644 --- a/src/parserutils.nim +++ b/src/parserutils.nim @@ -43,13 +43,9 @@ proc emojify*(node: XmlNode) = 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) + let text = tweet.querySelector(".QuoteTweet-text") + emojify(text) result = stripText(selectText(text, ".tweet-text")) result = stripTwitterUrls(result) @@ -59,11 +55,8 @@ proc getTweetText*(tweet: XmlNode): string = link = tweet.selectAttr(selector, "data-expanded-url") quote = tweet.querySelector(".QuoteTweet") text = tweet.querySelector(".tweet-text") - hasEmojis = not text.querySelector(".Emoji").isNil - - if hasEmojis: - emojify(text) + emojify(text) result = stripText(selectText(text, ".tweet-text")) if not quote.isNil and link.len > 0: