Skip to content

Commit

Permalink
Merge pull request #34223 from rushatgabhane/fix-case
Browse files Browse the repository at this point in the history
[HelpDot] Lower case a, the, and.
  • Loading branch information
MariaHCD authored Jan 11, 2024
2 parents da508cf + 38c0c8c commit e54abdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/scripts/createDocsRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ const platformNames = {
* @returns {String}
*/
function toTitleCase(str) {
return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1));
return _.map(str.split(' '), (word, i) => {
if (i !== 0 && (word.toLowerCase() === 'a' || word.toLowerCase() === 'the' || word.toLowerCase() === 'and')) {
return word.toLowerCase();
}
return word.charAt(0).toUpperCase() + word.substring(1);
}).join(' ');
}

/**
Expand Down

0 comments on commit e54abdf

Please sign in to comment.