mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 17:54:54 +02:00
Support rich text book descriptions
This commit is contained in:
parent
66b90e0841
commit
286185329d
14 changed files with 136 additions and 83 deletions
|
@ -8,6 +8,7 @@ const AudiobookCovers = require('../providers/AudiobookCovers')
|
|||
const CustomProviderAdapter = require('../providers/CustomProviderAdapter')
|
||||
const Logger = require('../Logger')
|
||||
const { levenshteinDistance, escapeRegExp } = require('../utils/index')
|
||||
const htmlSanitizer = require('../utils/htmlSanitizer')
|
||||
|
||||
class BookFinder {
|
||||
#providerResponseTimeout = 30000
|
||||
|
@ -463,6 +464,12 @@ class BookFinder {
|
|||
} else {
|
||||
books = await this.getGoogleBooksResults(title, author)
|
||||
}
|
||||
books.forEach((book) => {
|
||||
if (book.description) {
|
||||
book.description = htmlSanitizer.sanitize(book.description)
|
||||
book.descriptionPlain = htmlSanitizer.stripAllTags(book.description)
|
||||
}
|
||||
})
|
||||
return books
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue