use dompurify instead of sanitize-html

This commit is contained in:
les
2020-02-10 00:40:23 +01:00
parent e72b2822b9
commit 1dfd75a193
5 changed files with 65 additions and 75 deletions

View File

@@ -1,6 +1,7 @@
const { event: Event, resource: Resource, ap_user: APUser } = require('../api/models')
const debug = require('debug')('fediverse:resource')
const sanitize = require('sanitize-html')
const helpers = require('../helpers')
module.exports = {
// create a resource from AP Note
@@ -30,7 +31,7 @@ module.exports = {
// TODO should probably map links here
// clean resource
body.object.content = sanitize(body.object.content, {
body.object.content = helpers.sanitizeHTML(body.object.content, {
nonTextTags: ['style', 'script', 'textarea', 'noscript']
})