jedwards1211/preserve-case

Behaviour when the replacing single-"word" match is not good

Opened this issue · 1 comments

If you do the following

replace.all("a", "a", "bB")

The result is

"b b"

Which does not follow any apparent logic. I immediately felt this behaviour as buggy to say the least.

Sorry for the long delay, GitHub unfortunately didn't automatically make me watch this repo when I created it.

Thanks for bringing this up. The problem is it's inferring the type of the input "a" as space-separated, and converting bB from camel-case to space-separated. Probably I can make it use the case of the replacement bB when the input is ambiguous or one "word".