diff --git a/src/views/rss.nimf b/src/views/rss.nimf index afdd231..d000060 100644 --- a/src/views/rss.nimf +++ b/src/views/rss.nimf @@ -1,6 +1,6 @@ #? stdtmpl(subsChar = '$', metaChar = '#') ## SPDX-License-Identifier: AGPL-3.0-only -#import strutils, xmltree, strformat, options +#import strutils, xmltree, strformat, options, unicode #import ../types, ../utils, ../formatters, ../prefs # #proc getTitle(tweet: Tweet; retweet: string): string = @@ -8,7 +8,11 @@ #elif retweet.len > 0: result = &"RT by @{retweet}: " #elif tweet.reply.len > 0: result = &"R to @{tweet.reply[0]}: " #end if -#result &= xmltree.escape(stripHtml(tweet.text)) +#var text = stripHtml(tweet.text) +#if unicode.runeLen(text) > 32: +# text = unicode.runeSubStr(text, 0, 32) & "..." +#end if +#result &= xmltree.escape(text) #if result.len > 0: return #end if #if tweet.photos.len > 0: @@ -28,11 +32,10 @@ Twitter feed for: ${desc}. Generated by ${cfg.hostname} #let tweet = tweet.retweet.get(tweet) #let urlPrefix = getUrlPrefix(cfg) #let text = replaceUrls(tweet.text, defaultPrefs, absolute=urlPrefix) +
${text.replace("\n", "
\n")}
${text}
${cfg.hostname}${quoteLink}
${text}
+ #end if #if tweet.photos.len > 0: # for photo in tweet.photos: