Skip to content
Snippets Groups Projects
Commit 07492b7b authored by Zed's avatar Zed
Browse files

Escape rss titles

Fixes #168
parent 1811a232
No related branches found
No related tags found
No related merge requests found
......@@ -69,6 +69,7 @@
#var title = profile.fullname
#if not multi: title &= " / " & user
#end if
#title = xmltree.escape(title)
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel>
......@@ -100,7 +101,7 @@
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel>
<atom:link href="${link}" rel="self" type="application/rss+xml" />
<title>${list.name} / @${list.username}</title>
<title>${xmltree.escape(list.name)} / @${list.username}</title>
<link>${link}</link>
<description>Twitter feed for: ${list.name} by @${list.username}. Generated by ${hostname}</description>
<language>en-us</language>
......@@ -113,14 +114,15 @@
#proc renderSearchRss*(tweets: seq[Tweet]; name, param, hostname: string): string =
#let prefs = Prefs(replaceTwitter: hostname, replaceYouTube: "invidio.us")
#let link = &"https://{hostname}/search"
#let escName = xmltree.escape(name)
#result = ""
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel>
<atom:link href="${link}" rel="self" type="application/rss+xml" />
<title>Search results for "${name}"</title>
<title>Search results for "${escName}"</title>
<link>${link}</link>
<description>Twitter feed for search "${name}". Generated by ${hostname}</description>
<description>Twitter feed for search "${escName}". Generated by ${hostname}</description>
<language>en-us</language>
<ttl>40</ttl>
${renderRssTweets(tweets, prefs, hostname)}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment