Skip to content

Commit 2506a31

Browse files
author
Eric Elliott
committed
Merge pull request rsperberg#4 from rsperberg/master
add pattern for plural possessive (s')
2 parents 4794fe7 + 6e077ed commit 2506a31

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
@@ -18,6 +18,7 @@ var replacements = [
1818
{ searchFor: /'m\b/g, replaceWith: "’m"}, // I'm
1919
{ searchFor: /'re\b/g, replaceWith: "’re"}, // you're
2020
{ searchFor: /'s\b/g, replaceWith: "’s"}, // it's
21+
{ searchFor: /s'(\s)/g, replaceWith: "s’$1"}, // plural possessive
2122
{ searchFor: /'t\b/g, replaceWith: "’t"}, // don't
2223
{ searchFor: /'ve\b/g, replaceWith: "’ve"}, // I've
2324
{ searchFor: /(\s)'(\d\ds)/g, replaceWith: "$1’$2"}, // ’90s
@@ -26,7 +27,7 @@ var replacements = [
2627
{ searchFor: /"\./g, replaceWith: '.”'}, // period outside quote mark (transpose only)
2728
{ searchFor: /"\b/g, replaceWith: '“'}, // open quote (eg, precedes a 'word boundary')
2829
{ searchFor: /\b"/g, replaceWith: '”'}, // close quote (eg, is preceded by a 'word boundary') needs to be set to follow punctuation as well
29-
{ searchFor: / - /g, replaceWith: " — "} // em dash
30+
{ searchFor: / - /g, replaceWith: " — "} // em dash with spaces surrounding it
3031
];
3132
// using package.json script: cleanup to read README.md via cat
3233
var aFile = fs.readFile('/dev/stdin', 'utf8', function (err,data) {

0 commit comments

Comments
 (0)