summaryrefslogtreecommitdiff
path: root/routes.js
diff options
context:
space:
mode:
authorRaphael Kabo <raphaelkabo@gmail.com>2022-01-17 11:40:37 +0000
committerRaphael Kabo <raphaelkabo@gmail.com>2022-01-17 11:40:37 +0000
commit52551f4a84f24c8591a1228a17c792c8368afbbb (patch)
treeb15371ef238a2d955389fe5298408aaad559c999 /routes.js
parentdd155d1a7475a3b76007d7384ce216ecf290b19d (diff)
Updated marked implementation
Diffstat (limited to 'routes.js')
-rwxr-xr-xroutes.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/routes.js b/routes.js
index 9ec2b2a..4a2f02c 100755
--- a/routes.js
+++ b/routes.js
@@ -327,7 +327,7 @@ router.get('/:eventID', (req, res) => {
eventHasBegun = true;
}
let fromNow = moment.tz(event.start, event.timezone).fromNow();
- let parsedDescription = marked(event.description);
+ let parsedDescription = marked.parse(event.description);
let eventEditToken = event.editToken;
let escapedName = event.name.replace(/\s+/g, '+');
@@ -390,7 +390,7 @@ router.get('/:eventID', (req, res) => {
}
let metadata = {
title: event.name,
- description: marked(event.description, { renderer: render_plain() }).split(" ").splice(0, 40).join(" ").trim(),
+ description: marked.parse(event.description, { renderer: render_plain() }).split(" ").splice(0, 40).join(" ").trim(),
image: (eventHasCoverImage ? `https://${domain}/events/` + event.image : null),
url: `https://${domain}/` + req.params.eventID
};
@@ -481,7 +481,7 @@ router.get('/group/:eventGroupID', (req, res) => {
.lean() // Required, see: https://stackoverflow.com/questions/59690923/handlebars-access-has-been-denied-to-resolve-the-property-from-because-it-is
.then(async (eventGroup) => {
if (eventGroup) {
- let parsedDescription = marked(eventGroup.description);
+ let parsedDescription = marked.parse(eventGroup.description);
let eventGroupEditToken = eventGroup.editToken;
let escapedName = eventGroup.name.replace(/\s+/g, '+');
@@ -549,7 +549,7 @@ router.get('/group/:eventGroupID', (req, res) => {
}
let metadata = {
title: eventGroup.name,
- description: marked(eventGroup.description, { renderer: render_plain() }).split(" ").splice(0, 40).join(" ").trim(),
+ description: marked.parse(eventGroup.description, { renderer: render_plain() }).split(" ").splice(0, 40).join(" ").trim(),
image: (eventGroupHasCoverImage ? `https://${domain}/events/` + eventGroup.image : null),
url: `https://${domain}/` + req.params.eventID
};
@@ -681,7 +681,7 @@ router.post('/newevent', async (req, res) => {
usersCanComment: req.body.interactionCheckbox ? true : false,
maxAttendees: req.body.maxAttendees,
firstLoad: true,
- activityPubActor: ap.createActivityPubActor(eventID, domain, pair.public, marked(req.body.eventDescription), req.body.eventName, req.body.eventLocation, eventImageFilename, startUTC, endUTC, req.body.timezone),
+ activityPubActor: ap.createActivityPubActor(eventID, domain, pair.public, marked.parse(req.body.eventDescription), req.body.eventName, req.body.eventLocation, eventImageFilename, startUTC, endUTC, req.body.timezone),
activityPubEvent: ap.createActivityPubEvent(req.body.eventName, startUTC, endUTC, req.body.timezone, req.body.eventDescription, req.body.eventLocation),
activityPubMessages: [{ id: `https://${domain}/${eventID}/m/featuredPost`, content: JSON.stringify(ap.createFeaturedPost(eventID, req.body.eventName, startUTC, endUTC, req.body.timezone, req.body.eventDescription, req.body.eventLocation)) }],
publicKey: pair.public,