Skip to content

Added title case transformation command called 'Transform to Title Case'.#70990

Merged
rebornix merged 4 commits intomicrosoft:masterfrom
jaqra:feature/capitalcase
Mar 29, 2019
Merged

Added title case transformation command called 'Transform to Title Case'.#70990
rebornix merged 4 commits intomicrosoft:masterfrom
jaqra:feature/capitalcase

Conversation

@jaqra
Copy link
Contributor

@jaqra jaqra commented Mar 22, 2019

This is related to #70858

Before:
before

After:
after

@msftclas
Copy link

msftclas commented Mar 22, 2019

CLA assistant check
All CLA requirements met.

@jaqra jaqra changed the title Added capital case tranformation command. Added capital case transformation command called 'Transform to Capitalcase'. Mar 25, 2019
@rebornix
Copy link
Member

@jaqra thanks for your contribution! I'd love to call it Transform to Title Case considering that Capital might be confusing

FYI

  • Microsoft Word calls it Capitalize Each Word
  • Google Docs calls it Title Case
  • macOS calls it Transformation -> Capitalize
  • Sublime Text calls it Title Case

@rebornix rebornix added this to the On Deck milestone Mar 28, 2019
@jaqra jaqra changed the title Added capital case transformation command called 'Transform to Capitalcase'. Added title case transformation command called 'Transform to Title Case'. Mar 28, 2019
@jaqra
Copy link
Contributor Author

jaqra commented Mar 28, 2019

@rebornix done

}

protected _modifyText(text: string): string {
return text.replace(/\S+/g, function (word: string) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use editor.wordSeparators to split words?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rebornix well, however should we exclude single quote char?

For ex:

Excluded:

  • jaqra's commit -> Jaqra's Commit
  • this is 'single quote char' -> This Is 'single Quote Char'

Included:

  • jaqra's commit -> Jaqra'S Commit
  • this is 'single quote char' -> This Is 'Single Quote Char'

My brain is burning 🧠🔥

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should include (if it exists in word separators)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that change acceptable on _modifyText method's parameter?

Here is some results:

Capture

@rebornix rebornix modified the milestones: On Deck, April 2019 Mar 29, 2019
@rebornix rebornix merged commit 2b518c1 into microsoft:master Mar 29, 2019
@jmbockhorst jmbockhorst mentioned this pull request Apr 12, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants