Skip to content

Commit e06bd8c

Browse files
committed
add close quote after punctuation
1 parent 2506a31 commit e06bd8c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/cleanup.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ var replacements = [
2626
{ searchFor: /",/g, replaceWith: ',”'}, // comma outside quote mark
2727
{ searchFor: /"\./g, replaceWith: '.”'}, // period outside quote mark (transpose only)
2828
{ searchFor: /"\b/g, replaceWith: '“'}, // open quote (eg, precedes a 'word boundary')
29-
{ searchFor: /\b"/g, replaceWith: '”'}, // close quote (eg, is preceded by a 'word boundary') needs to be set to follow punctuation as well
29+
{ searchFor: /\b"/g, replaceWith: '”'}, // close quote (eg, is preceded by a 'word boundary')
30+
{ searchFor: /\b([\.|,|\?|!|;|:|-|])"/g, replaceWith: '$1”'}, // close quote after punctuation (which is itself preceded by a 'word boundary')
3031
{ searchFor: / - /g, replaceWith: " — "} // em dash with spaces surrounding it
3132
];
3233
// using package.json script: cleanup to read README.md via cat

0 commit comments

Comments
 (0)