From ccb65bd9122ac3e45a640e66113455ce844c92d9 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Tue, 12 Sep 2023 01:15:26 -0700 Subject: [PATCH] do not xmlescape entire description --- mangle/generators/rss.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mangle/generators/rss.py b/mangle/generators/rss.py index 20acc74..c0fc657 100644 --- a/mangle/generators/rss.py +++ b/mangle/generators/rss.py @@ -2,6 +2,8 @@ # -*-:python; coding:utf-8; -*- # author: Louis Abel # modified version of repo-rss from yum utils +# changelog +# -> 20230912: do not xmlescape entire description variable import sys import os @@ -116,7 +118,7 @@ class RepoRSS: title = xmlescape(str(package)) date = time.gmtime(float(package.buildtime)) description = package.description - link = package.remote_location() + link = xmlescape(package.remote_location()) # form description changelog = '' count = 0 @@ -133,9 +135,9 @@ class RepoRSS: author = meta['author'] desc = meta['text'] changelog += f'{cl_date} - {author}\n{desc}\n\n' - description = f'

{package.name} - {package.summary}

\n\n' - description += '

%s

\n\n

Change Log:

\n\n' % description.replace("\n", "
\n") - description += f'
{changelog}
' + description = '

{} - {}

\n\n'.format(xmlescape(package.name), xmlescape(package.summary)) + description += '

%s

\n\n

Change Log:

\n\n' % xmlescape(description.replace("\n", "
\n")) + description += '
{}
'.format(xmlescape(changelog)) # start item etbobj.start('item', {}) @@ -161,7 +163,7 @@ class RepoRSS: # end link # start description etbobj.start('description', {}) - etbobj.data(xmlescape(description)) + etbobj.data(description) etbobj.end('description') # end description etbobj.end('item')