diff --git a/src/controllers/DelegateController.ts b/src/controllers/DelegateController.ts index c93a22a..6a156d1 100644 --- a/src/controllers/DelegateController.ts +++ b/src/controllers/DelegateController.ts @@ -55,6 +55,11 @@ export default class DelegateController { proposedVersion.contacts.peoples = proposedVersion.contacts.peoples.filter((p: any) => !p.isResponsable) } + // sanitize short description + if (Utils.isStrUsable(proposedVersion.shortDescription)) { + proposedVersion.shortDescription = proposedVersion.shortDescription.replace(/\n/g, '') + } + // sanitize long description if (Utils.isStrUsable(proposedVersion.descriptionLong)) { proposedVersion.descriptionLong = proposedVersion.descriptionLong.replace(/\n/g, '') diff --git a/src/controllers/PublicController.ts b/src/controllers/PublicController.ts index b3f02c8..395c6c7 100644 --- a/src/controllers/PublicController.ts +++ b/src/controllers/PublicController.ts @@ -51,7 +51,7 @@ export default class PublicController { return { _id: o._id, name: version.name, - description: version.descriptionShort, + description: version.descriptionShort.replace(/\n/g, ''), thumbnail: version.thumbnail.key, tags: version.tags === null ? 'tags_not_found' : version.tags, slug: o.get('slugs')[o.get('slugs').length -1]