default link target is _blank and target attr is allowed

This commit is contained in:
les 2021-03-15 22:27:07 +01:00
parent 389cf5166d
commit d8b1c82056
No known key found for this signature in database
GPG key ID: 352918250B012177
3 changed files with 3 additions and 3 deletions

View file

@ -133,7 +133,7 @@ export default {
new ListItem(),
new Code(),
new History(),
new Link({ openOnClick: false }),
new Link({ openOnClick: false, target: '_blank' }),
new Bold(),
new Italic(),
new Strike(),

View file

@ -351,7 +351,7 @@ const eventController = {
const eventDetails = {
title: body.title,
// remove html tags
description: helpers.sanitizeHTML(linkifyHtml(body.description)),
description: helpers.sanitizeHTML(linkifyHtml(body.description, { target: '_blank' })),
multidate: body.multidate,
start_datetime: body.start_datetime,
end_datetime: body.end_datetime,

View file

@ -51,7 +51,7 @@ module.exports = {
return domPurify.sanitize(html, {
ALLOWED_TAGS: ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'br',
'h6', 'b', 'a', 'li', 'ul', 'ol', 'code', 'blockquote', 'u', 's', 'strong'],
ALLOWED_ATTR: ['href']
ALLOWED_ATTR: ['href', 'target']
})
},