-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: TitleCase enhancement #28
base: master
Are you sure you want to change the base?
Conversation
I am commenting on this to give it more visibility. It would be nice if this PR could be merged and this shortcoming could be fixed. Articles and prepositions should not be capitalized in titles according to the APA guidelines. Thanks! |
lib/recase.dart
Outdated
!isFirstWord && punctuationList.indexOf(words[word.key - 1]) > 0; | ||
var isExcluded = exclusionListEng.indexOf(word.value) > 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!isFirstWord && punctuationList.indexOf(words[word.key - 1]) > 0; | |
var isExcluded = exclusionListEng.indexOf(word.value) > 0; | |
!isFirstWord && punctuationList.contains(words[word.key - 1]); | |
var isExcluded = exclusionListEng.contains(word.value); |
I think you should use contains
, because indexOf(...) > 0
will return false if the value is the first element in the list, but it should be true for that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done 👍🏼
Status
DONE
Description
enhancement changes requested in issue #27 for TitleCase
Type of Change
✨ New feature (non-breaking change which adds functionality)