diff --git a/netlify/functions/batchUpdateMeetingSummariesArray.js b/netlify/functions/batchUpdateMeetingSummariesArray.js index 8bdb256..29985a5 100644 --- a/netlify/functions/batchUpdateMeetingSummariesArray.js +++ b/netlify/functions/batchUpdateMeetingSummariesArray.js @@ -7,10 +7,12 @@ const MAX_CONCURRENT_REQUESTS = 10; function sanitizeObject(item) { if (typeof item === 'string') { + // Replace line breaks with spaces // Only replace en dash (U+2013) or em dash (U+2014) with ASCII hyphen '-' // Replace curly single quotes ’ and ‘ with straight ASCII apostrophe ' // Replace curly double quotes ” and “ with straight ASCII quote " return item + .replace(/\r?\n/g, ' ') .replace(/[\u2013\u2014]/g, '-') .replace(/[\u2018\u2019]/g, "'") .replace(/[\u201C\u201D]/g, '"') diff --git a/netlify/functions/batchUpdateMeetingSummariesById.js b/netlify/functions/batchUpdateMeetingSummariesById.js index eed498d..83bd65f 100644 --- a/netlify/functions/batchUpdateMeetingSummariesById.js +++ b/netlify/functions/batchUpdateMeetingSummariesById.js @@ -7,14 +7,16 @@ const MAX_CONCURRENT_REQUESTS = 10; function sanitizeObject(item) { if (typeof item === 'string') { + // Replace line breaks with spaces // Only replace en dash (U+2013) or em dash (U+2014) with ASCII hyphen '-' // Replace curly single quotes ’ and ‘ with straight ASCII apostrophe ' // Replace curly double quotes ” and “ with straight ASCII quote " return item - .replace(/[\u2013\u2014]/g, '-') - .replace(/[\u2018\u2019]/g, "'") - .replace(/[\u201C\u201D]/g, '"') - .trim(); + .replace(/\r?\n/g, ' ') + .replace(/[\u2013\u2014]/g, '-') + .replace(/[\u2018\u2019]/g, "'") + .replace(/[\u201C\u201D]/g, '"') + .trim(); } if (Array.isArray(item)) {