diff --git a/package.json b/package.json index 02bc7bcd..5c439ce9 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "jsdom": "^16.1.0", "jsonwebtoken": "^8.5.1", "less": "^3.10.3", + "linkifyjs": "^2.1.9", "lodash": "^4.17.14", "mkdirp": "^1.0.3", "moment-timezone": "^0.5.27", diff --git a/server/api/controller/event.js b/server/api/controller/event.js index d57d2e4a..747014ca 100644 --- a/server/api/controller/event.js +++ b/server/api/controller/event.js @@ -6,6 +6,8 @@ const fs = require('fs') const { Op } = require('sequelize') const _ = require('lodash') const helpers = require('../../helpers') +const linkifyHtml = require('linkifyjs/html') +const Sequelize = require('sequelize') const { event: Event, @@ -15,7 +17,6 @@ const { notification: Notification, ap_user: APUser } = require('../models') -const Sequelize = require('sequelize') const exportController = require('./export') const debug = require('debug')('controller:event') @@ -222,7 +223,7 @@ const eventController = { const eventDetails = { title: body.title, // remove html tags - description: helpers.sanitizeHTML(body.description), + description: helpers.sanitizeHTML(linkifyHtml(body.description)), multidate: body.multidate, start_datetime: body.start_datetime, end_datetime: body.end_datetime, @@ -296,7 +297,7 @@ const eventController = { const eventDetails = { title: body.title, // remove html tags - description: helpers.sanitizeHTML(body.description), + description: helpers.sanitizeHTML(linkifyHtml(body.description)), multidate: body.multidate, start_datetime: body.start_datetime, end_datetime: body.end_datetime,