From 69f5a555cbd5437e4f658b04c5300431a41b61da Mon Sep 17 00:00:00 2001 From: Zed Date: Tue, 2 Jul 2019 01:38:14 +0200 Subject: [PATCH] Fix quote reply edgecase --- src/parserutils.nim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/parserutils.nim b/src/parserutils.nim index a1f8c0a..0070127 100644 --- a/src/parserutils.nim +++ b/src/parserutils.nim @@ -123,8 +123,12 @@ proc parseTweetStats*(node: XmlNode): TweetStats = proc parseTweetReply*(node: XmlNode): seq[string] = let reply = node.select(".ReplyingToContextBelowAuthor") if reply == nil: return - for username in reply.selectAll("a"): - result.add username.selectText("b") + + let selector = if "Quote" in node.attr("class"): "b" + else: "a b" + + for username in reply.selectAll(selector): + result.add username.innerText() proc getGif(player: XmlNode): Gif = let