mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-05 02:34:56 +02:00
Add:Full podcast episode description parsed and viewable in modal #492
This commit is contained in:
parent
c4bfa266b0
commit
a394f38fe9
9 changed files with 150 additions and 10 deletions
|
@ -3,7 +3,7 @@ const sanitizeHtml = require('../libs/sanitizeHtml')
|
|||
function sanitize(html) {
|
||||
const sanitizerOptions = {
|
||||
allowedTags: [
|
||||
'p', 'ol', 'ul', 'a', 'strong', 'em'
|
||||
'p', 'ol', 'ul', 'li', 'a', 'strong', 'em'
|
||||
],
|
||||
disallowedTagsMode: 'discard',
|
||||
allowedAttributes: {
|
||||
|
|
|
@ -81,9 +81,16 @@ function extractEpisodeData(item) {
|
|||
}
|
||||
}
|
||||
|
||||
// Full description with html
|
||||
if (item['content:encoded']) {
|
||||
const rawDescription = (extractFirstArrayItem(item, 'content:encoded') || '').trim()
|
||||
episode.description = htmlSanitizer.sanitize(rawDescription)
|
||||
}
|
||||
|
||||
// Supposed to be the plaintext description but not always followed
|
||||
if (item['description']) {
|
||||
const rawDescription = extractFirstArrayItem(item, 'description') || ''
|
||||
episode.description = htmlSanitizer.sanitize(rawDescription)
|
||||
if (!episode.description) episode.description = htmlSanitizer.sanitize(rawDescription)
|
||||
episode.descriptionPlain = htmlSanitizer.stripAllTags(rawDescription)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue