Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions netlify/functions/batchUpdateMeetingSummariesArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, '"')
Expand Down
10 changes: 6 additions & 4 deletions netlify/functions/batchUpdateMeetingSummariesById.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down