Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Title filter capitalizes characters after the apostrophe in a contraction #93

Open
nightbook opened this Issue · 1 comment

2 participants

@nightbook

Hello,

I'm writing to file a minor issue, but it's cause me some grief.

With a contraction such as don't, won't shouldn't, etc. if the |title filter is applied to a string containing these then the characters after the apostrophe are considered a new word and so are capitalized.

So the sentence 'I didn't do it' when pipped through the |title filter we get:
'I Didn'T Do It' with a capital T...

Thank you

@njl njl referenced this issue from a commit
@njl njl Fixes Issue #93 by implementing a title algorithm
The stdlib title function provides a fundamentally correct and
completely useless version of the title function, that defines
words as things seperated by not letters. This changes the semantics to
make words things that are seperated by spaces.
7fe70fd
@njl njl referenced this issue from a commit
@njl njl Fix to #93, this time respecting whitespace
Rejigger of title split to respect whitespace, also capitalize follow-on
hyphenated words.
c4b6fd3
@njl njl referenced this issue from a commit in njl/jinja2
@njl njl Fix to #93, this time respecting whitespace
Rejigger of title split to respect whitespace, also capitalize follow-on
hyphenated words.
8f0c8ee
@liZe

The new implementation doesn't lower the other letters : "ABC" | title gives "ABC" (it was "Abc" before).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.