From cd4e873a4532922101555904700d690c43c375fd Mon Sep 17 00:00:00 2001 From: Zed Date: Fri, 21 Jun 2019 04:35:48 +0200 Subject: [PATCH] Escape tweet text --- src/views/tweet.nim | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/views/tweet.nim b/src/views/tweet.nim index 6bd8879..503fd5c 100644 --- a/src/views/tweet.nim +++ b/src/views/tweet.nim @@ -92,23 +92,22 @@ # #proc renderTweet*(tweet: Tweet; class=""): string =
-
-
- ${renderHeading(tweet)} -
-
- ${linkifyText(tweet.text)} -
+
+
+ ${renderHeading(tweet)} +
+
+ ${linkifyText(xmltree.escape(tweet.text))}
- #if tweet.photos.len > 0: - ${renderMediaGroup(tweet)} - #elif tweet.videoThumb.isSome: - ${renderVideo(tweet)} - #elif tweet.gif.isSome: - ${renderGif(tweet)} - #end if - ${renderStats(tweet)}
+ #if tweet.photos.len > 0: + ${renderMediaGroup(tweet)} + #elif tweet.videoThumb.isSome: + ${renderVideo(tweet)} + #elif tweet.gif.isSome: + ${renderGif(tweet)} + #end if + ${renderStats(tweet)}
#end proc