Skip to content

Commit

Permalink
Trim podcast descriptions advplyr#3720
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Dec 17, 2024
1 parent 858d697 commit 63b3f22
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/utils/podcastUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ function extractPodcastMetadata(channel) {

if (channel['description']) {
const rawDescription = extractFirstArrayItem(channel, 'description') || ''
metadata.description = htmlSanitizer.sanitize(rawDescription)
metadata.descriptionPlain = htmlSanitizer.stripAllTags(rawDescription)
metadata.description = htmlSanitizer.sanitize(rawDescription.trim())
metadata.descriptionPlain = htmlSanitizer.stripAllTags(rawDescription.trim())
}

const arrayFields = ['title', 'language', 'itunes:explicit', 'itunes:author', 'pubDate', 'link', 'itunes:type']
Expand Down Expand Up @@ -103,8 +103,8 @@ function extractEpisodeData(item) {
// Supposed to be the plaintext description but not always followed
if (item['description']) {
const rawDescription = extractFirstArrayItem(item, 'description') || ''
if (!episode.description) episode.description = htmlSanitizer.sanitize(rawDescription)
episode.descriptionPlain = htmlSanitizer.stripAllTags(rawDescription)
if (!episode.description) episode.description = htmlSanitizer.sanitize(rawDescription.trim())
episode.descriptionPlain = htmlSanitizer.stripAllTags(rawDescription.trim())
}

if (item['pubDate']) {
Expand Down

0 comments on commit 63b3f22

Please sign in to comment.