panzerdp / voca

The ultimate JavaScript string library
https://vocajs.pages.dev
MIT License
3.61k stars 136 forks source link

Title Abbreviations #50

Open LandonSchropp opened 4 years ago

LandonSchropp commented 4 years ago

Welcome to Voca's GitHub repo!

Expected behavior :smile_cat:

When title casing an abbreviation, I would expect the abbreviation to be preserved.

voca.titleCase("HTML is Awesome") // => "HTML is Awesome!"
voca.titleCase("JS is Cool") // => "JS is Cool"

I expect Voca's titleCase function to respect all title rules. Maybe this warrants a separate function or an additional option?

Actual behavior :crying_cat_face:

Instead, Voca converts these words

voca.titleCase("HTML is Awesome") // => "Html is Awesome!"
voca.titleCase("JS is Cool") // => "Js is Cool"

Steps to reproduce :construction_worker:

Call the functions as described above.

Technical details: :wrench:

Browser/OS type: macOS 10.15.3 Node version: 13