mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-09 17:04:58 +02:00
Update custom metadata provider results to sanitize html descriptions #3880
This commit is contained in:
parent
e096da1b4d
commit
558173e086
3 changed files with 12 additions and 113 deletions
|
@ -1,7 +1,17 @@
|
|||
const sanitizeHtml = require('../libs/sanitizeHtml')
|
||||
const { entities } = require('./htmlEntities')
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} html
|
||||
* @returns {string}
|
||||
* @throws {Error} if input is not a string
|
||||
*/
|
||||
function sanitize(html) {
|
||||
if (typeof html !== 'string') {
|
||||
throw new Error('sanitizeHtml: input must be a string')
|
||||
}
|
||||
|
||||
const sanitizerOptions = {
|
||||
allowedTags: ['p', 'ol', 'ul', 'li', 'a', 'strong', 'em', 'del', 'br', 'b', 'i'],
|
||||
disallowedTagsMode: 'discard',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue