File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,13 @@ const MAX_CONCURRENT_REQUESTS = 10;
88function sanitizeObject ( item ) {
99 if ( typeof item === 'string' ) {
1010 // Only replace en dash (U+2013) or em dash (U+2014) with ASCII hyphen '-'
11- return item . replace ( / [ \u2013 \u2014 ] / g, '-' ) ;
11+ // Replace curly single quotes ’ and ‘ with straight ASCII apostrophe '
12+ // Replace curly double quotes ” and “ with straight ASCII quote "
13+ return item
14+ . replace ( / [ \u2013 \u2014 ] / g, '-' )
15+ . replace ( / [ \u2018 \u2019 ] / g, "'" )
16+ . replace ( / [ \u201C \u201D ] / g, '"' )
17+ . trim ( ) ;
1218 }
1319
1420 if ( Array . isArray ( item ) ) {
Original file line number Diff line number Diff line change @@ -8,7 +8,13 @@ const MAX_CONCURRENT_REQUESTS = 10;
88function sanitizeObject ( item ) {
99 if ( typeof item === 'string' ) {
1010 // Only replace en dash (U+2013) or em dash (U+2014) with ASCII hyphen '-'
11- return item . replace ( / [ \u2013 \u2014 ] / g, '-' ) ;
11+ // Replace curly single quotes ’ and ‘ with straight ASCII apostrophe '
12+ // Replace curly double quotes ” and “ with straight ASCII quote "
13+ return item
14+ . replace ( / [ \u2013 \u2014 ] / g, '-' )
15+ . replace ( / [ \u2018 \u2019 ] / g, "'" )
16+ . replace ( / [ \u201C \u201D ] / g, '"' )
17+ . trim ( ) ;
1218 }
1319
1420 if ( Array . isArray ( item ) ) {
You can’t perform that action at this time.
0 commit comments