mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-24 12:54:31 +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
|
@ -1,11 +1,9 @@
|
|||
const sanitizeHtml = require('../libs/sanitizeHtml')
|
||||
const { entities } = require("./htmlEntities");
|
||||
const { entities } = require('./htmlEntities')
|
||||
|
||||
function sanitize(html) {
|
||||
const sanitizerOptions = {
|
||||
allowedTags: [
|
||||
'p', 'ol', 'ul', 'li', 'a', 'strong', 'em', 'del', 'br'
|
||||
],
|
||||
allowedTags: ['p', 'ol', 'ul', 'li', 'a', 'strong', 'em', 'del', 'br', 'b', 'i'],
|
||||
disallowedTagsMode: 'discard',
|
||||
allowedAttributes: {
|
||||
a: ['href', 'name', 'target']
|
||||
|
@ -34,6 +32,6 @@ function decodeHTMLEntities(strToDecode) {
|
|||
if (entity in entities) {
|
||||
return entities[entity]
|
||||
}
|
||||
return entity;
|
||||
return entity
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue