Add:HTML sanitizer lib to support html in podcasts and replace strip html lib

This commit is contained in:
advplyr 2022-05-27 19:41:40 -05:00
parent 96232676cb
commit c4bfa266b0
9 changed files with 1051 additions and 252 deletions

View file

@ -1,4 +1,3 @@
const { stripHtml } = require('string-strip-html')
const { getId } = require('../../utils/index')
const AudioFile = require('../files/AudioFile')
const AudioTrack = require('../files/AudioTrack')
@ -78,8 +77,7 @@ class PodcastEpisode {
episodeType: this.episodeType,
title: this.title,
subtitle: this.subtitle,
// description: this.description,
description: this.descriptionPlain, // Temporary stripping HTML until proper cleaning is implemented
description: this.description,
enclosure: this.enclosure ? { ...this.enclosure } : null,
pubDate: this.pubDate,
audioFile: this.audioFile.toJSON(),
@ -108,10 +106,6 @@ class PodcastEpisode {
if (this.episode) return `${this.episode} - ${this.title}`
return this.title
}
get descriptionPlain() {
if (!this.description) return ''
return stripHtml(this.description).result
}
setData(data, index = 1) {
this.id = getId('ep')