Skip to content

Commit 621ca95

Browse files
graceparkrachmari
andauthored
GraphQL Bug: add back apostrophe (github#35227)
Co-authored-by: Rachael Sewell <rachmari@github.com>
1 parent 18a385f commit 621ca95

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/graphql/scripts/utils/process-previews.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ const inputOrPayload = /(Input|Payload)$/m
77
export default function processPreviews(previews) {
88
// clean up raw yml data
99
previews.forEach((preview) => {
10-
// remove any extra info that follows a hyphen
11-
preview.title = sentenceCase(preview.title.replace(/ -.+/, '')).replace('it hub', 'itHub') // fix overcorrected `git hub` from sentenceCasing
10+
preview.title = sentenceCase(preview.title)
11+
.replace(/ -.+/, '') // remove any extra info that follows a hyphen
12+
.replace('it hub', 'itHub') // fix overcorrected `git hub` from sentenceCasing
13+
.replace(' s ', "'s ") // sentenceCase replaces apostrophes with spaces
1214

1315
// Add `preview` to the end of titles if needed
1416
preview.title = preview.title.endsWith('preview') ? preview.title : `${preview.title} preview`

0 commit comments

Comments
 (0)