From ff15cea8229ea8c5770902d3a634735e599defe8 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 11 Jan 2021 21:38:31 +0000 Subject: [PATCH] Remove html from news items imported from rss --- newsdaemon.py | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/newsdaemon.py b/newsdaemon.py index 4f74d95bf..f079916e9 100644 --- a/newsdaemon.py +++ b/newsdaemon.py @@ -26,6 +26,7 @@ from posts import archivePostsForPerson from content import removeHtmlTag from content import dangerousMarkup from content import validHashTag +from utils import removeHtml from utils import getFullDomain from utils import loadJson from utils import saveJson @@ -506,14 +507,7 @@ def _convertRSStoActivityPub(baseDir: str, httpPrefix: str, rssDescription = '' # get the rss description if it exists - rssDescription = _removeControlCharacters(item[4]) - if rssDescription.startswith('', '') - rssDescription = rssDescription.replace(']]', '') - if '&' in rssDescription: - rssDescription = html.unescape(rssDescription) - rssDescription = '

' + rssDescription + '

' + rssDescription = '

' + removeHtml(item[4]) + '

' mirrored = item[7] postUrl = url @@ -526,20 +520,9 @@ def _convertRSStoActivityPub(baseDir: str, httpPrefix: str, postUrl += '/index.html' # add the off-site link to the description - if rssDescription and \ - not dangerousMarkup(rssDescription, allowLocalNetworkAccess): - rssDescription += \ - '
' + \ - translate['Read more...'] + '' - else: - rssDescription = \ - '' + \ - translate['Read more...'] + '' - - # remove image dimensions - if '' + \ + translate['Read more...'] + '' followersOnly = False # NOTE: the id when the post is created will not be