Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Period at end of quoted string #24

Open
jaquet9 opened this issue Oct 16, 2022 · 0 comments
Open

Period at end of quoted string #24

jaquet9 opened this issue Oct 16, 2022 · 0 comments

Comments

@jaquet9
Copy link

jaquet9 commented Oct 16, 2022

"this is a test." gets title cased to "This Is a test." instead of "This Is a Test."

A fix is to update the following code from:

// Ignore intentional capitalization
if (current.substr(1).search(/[A-Z]|\../) > -1) {
  return current;
}

to:

// Ignore intentional capitalization
if (current.substr(1).search(/[A-Z]|\.[a-z0-9\u00C0-\u00FF]/) > -1) {
  return current;
}

or possibly better using test() instead of search():

// Ignore intentional capitalization
if (/[A-Z]|\.[a-z0-9\u00C0-\u00FF]/.test(current.substr(1))) {
  return current;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant