-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Added support for Unicode formats and code casing #85
Conversation
Will do when merged… 🙂 |
This is ready to be merged. |
Yeah you can just click merge, if that's the case. Likely did not want to merge it, as I was not sure, whether you still wanted to add some things. |
Very nice !! :-) Did you plan to allow enabling casing without code casing ? I don't care about |
The new coding cases have a separate checkbox on the options page.
The coding cases do not make the other letters lowercase like "Capitalize Each Word" does. We could add an option for "Capitalize Each Word" to not make the other letters lowercase as well, if there was interest. |
Fine!
So the upper camel case should do the job.
I don't think there is interest. I let you know in case. |
Possibly depending on your use case. All the coding cases will of course remove any whitespace or other special characters. |
Oh! I didn't expect this behavior! :-D However, I would like very much it supports acronyms. With |
Thanks for testing it and for the feedback. This was a deliberate choice to handle words with multiple consecutive capitals, but I can change this in my next PR. It it just a trivial change to the regular expression.
It looks like I misspoke above, as I forgot about the constant and train cases, which require lowercaseing the string to convert them to the other cases. Keeping the existing case would also make the conversion irreversible, as However, we could add an option for the coding cases to not make the other letters lowercase, if there was interest. |
While testing
Well, IMHO the best would be easier, that is, any whitespace or other special characters would be removed, of course, but always considering them as word separators, never making them void.
:-)
It's always using lowercase, but it's fine (except with one-letter-words and acronyms) because it preserves uppercase when needed. :-)
No sense.
It's right for one-letter-words, and it also has a sense for acronyms, since they are made with initials!
IMHO the best thing to do would be:
In fact, yes, it could be a good idea to just let case as is, without trying to recognize acronyms, because I'm using sometimes a mix between Pascal_Snake_Case and UpperCamelCase. (However I need some more experimentation to see what would really be useful.) |
That is intentional. If there is any whitespace in the string, it splits by that instead of the special characters. The hierarchy currently is whitespace, then special characters and lastly casing transitions.
The problem with that is your
OK, thanks for the feedback. I will make this change in my next PR. If you want to test it now, in this line:
/\p{Upper}*\P{Upper}+|\p{Upper}+/gu regular expression to /\p{Upper}\P{Upper}*|\P{Upper}+/gu .
The question is how to differentiate acronyms from one letter words...
Please feel free to open additional issues if you find anything that would be useful. |
OK, I got it. If there is no space, all special characters are separators.
Perso I prefer
No, thanks, I'll wait.
It's not possible, that's why it needs an option. (I understand a setting with checkbox or radio buttons.) Alternative: suggest both in the context menu (but that won't make it shorter ...)
Are you able to detect constant and train cases, to not apply lowercase in other cases ?
Anyway, all of that is not high-priority. |
I used some of the test cases from this library when developing this, so I believe it is the correct behavior. However, I am always open to changing it if needed and updating the regular expressions.
I can ping you on my next PR if I remember... You could subscribe to this repository as well, so you would automatically be notified of any new PRs. 😉
OK, please create an issue with specifically what you want this new option to do. Which coding cases should it apply to? Some test cases would be helpful as well, so that we could confirm it is working as intended.
Not currently. It prioritizes a simple implementation, so it uses the same split function for all of the coding cases. |
Sorry, I don't find how to subscribe to this repository. Where is the button please? :-)
Thank you. :-) However I forgot to ask: |
Click the "Watch" dropdown button at the top right of the main page of the repository and then select your preferred options.
Yes, Firefox/Thunderbird gets that text directly from the AMO/ATN listings respectively, which does not apply to side loaded extensions. You could just open the listing on AMO/ATN directly though to copy from, for example: https://addons.mozilla.org/firefox/addon/unicodify-text-transformer/. Not being able to copy from the options page should be fixed by TinyWebEx/CommonCss#4. |
tabs.executeScript()
and updated manifest files #83, which require first upgrading to MV3@rugk: