Fix #93 by implementing a title algorithm, instead of relying on stdlib's lame version... #102

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

njl commented Mar 12, 2012

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.

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.
Owner

mitsuhiko commented Mar 12, 2012

This will destroy different kinds of whitespace. This is better solved with unicode regular expressions.

Owner

mitsuhiko commented Mar 12, 2012

Eg:

for item in re.compile(r'(\s+)(?u)').split(...):
  #item is either whitespace or item
  ...

njl added some commits Mar 12, 2012

Fix #77 by adding note to switching document
Explaining that {% empty %} in Django loops is {% else %} in Jinja2.
Fix to #93, this time respecting whitespace
Rejigger of title split to respect whitespace, also capitalize follow-on
hyphenated words.

@njl njl closed this Mar 13, 2012

Contributor

njl commented Mar 13, 2012

Closed, separate, cleaner pull is #103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment