Remove CDATA

main
Bob Mottram 2020-10-10 11:16:06 +01:00
parent fc1bc510a6
commit a36132bfb7
1 changed files with 5 additions and 1 deletions

View File

@ -99,11 +99,14 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
# get the rss description if it exists
rssDescription = removeControlCharacters(item[4])
if rssDescription.startswith('<![CDATA['):
rssDescription = rssDescription.replace('<![CDATA[', '')
rssDescription = rssDescription.replace(']]>', '')
# add the off-site link to the description
if rssDescription:
rssDescription += \
'\n\n<a href="' + url + '">' + \
'<br><br><a href="' + url + '">' + \
translate['Read more...'] + '</a>'
else:
rssDescription = \
@ -142,6 +145,7 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
blog['object']['url'] = \
httpPrefix + '://' + domain + '/@news/' + statusNumber
blog['object']['published'] = dateStr
blog['object']['content'] = rssDescription
postId = newPostId.replace('/', '#')