Closed q3cpma closed 2 years ago
Well that's embarrassing, thanks for the bug report. Can't believe I don't have a test case for that, despite the behaviour being mentioned in the README. The code looks like it's trying to do it:
https://github.com/wezm/titlecase/blob/93667678ed18f2b8b4762cfa838070bb014d391c/src/lib.rs#L115-L116
But I suspect the \A
and \z
in SMALL_RE
are not right.
https://github.com/wezm/titlecase/blob/93667678ed18f2b8b4762cfa838070bb014d391c/src/lib.rs#L81
On Tue Aug 30, 2022 at 1:20 AM CEST, Wesley Moore wrote:
Well that's embarrassing, thanks for the bug report. Can't believe I don't have a test case for that, despite the behaviour being mentioned in the README. The code looks like it's trying to do it:
https://github.com/wezm/titlecase/blob/93667678ed18f2b8b4762cfa838070bb014d391c/src/lib.rs#L115-L116
But I suspect the
\A
and\z
inSMALL_RE
are not right.
Having tried to do it by myself, I suspect you need lookbehind/lookahead constraints if you want to do it with regexp, which Rust don't have. So, a manual scanner may be needed.
Published v2.1.0 with a fix for this.
On Tue Aug 30, 2022 at 2:22 PM CEST, Wesley Moore wrote:
Published v2.1.0 with a fix for this.
Thanks.
For example