mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-15 22:01:37 +00:00
support markdown in descriptions
also convert html descriptions from Audible and iTunes to markdown
This commit is contained in:
parent
ed82a5aa19
commit
41b685d118
6 changed files with 42 additions and 8 deletions
|
|
@ -1,5 +1,6 @@
|
|||
const { xmlToJSON } = require('../index')
|
||||
const htmlSanitizer = require('../htmlSanitizer')
|
||||
const TurndownService = require('turndown')
|
||||
var turndownService = new TurndownService()
|
||||
|
||||
function parseCreators(metadata) {
|
||||
if (!metadata['dc:creator']) return null
|
||||
|
|
@ -87,7 +88,7 @@ function fetchDescription(metadata) {
|
|||
// check if description is HTML or plain text. only plain text allowed
|
||||
// calibre stores < and > as < and >
|
||||
description = description.replace(/</g, '<').replace(/>/g, '>')
|
||||
return htmlSanitizer.stripAllTags(description)
|
||||
return turndownService.turndown(description)
|
||||
}
|
||||
|
||||
function fetchGenres(metadata) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue