mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-06 07:25:03 +02:00
Add:HTML sanitizer lib to support html in podcasts and replace strip html lib
This commit is contained in:
parent
96232676cb
commit
c4bfa266b0
9 changed files with 1051 additions and 252 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue