Ticket #11972: title_filter_ordinal_patch.diff

File title_filter_ordinal_patch.diff, 536 bytes (added by schwank@…, 15 years ago)
  • defaultfilters.py

     
    249249
    250250def title(value):
    251251    """Converts a string into titlecase."""
    252     return re.sub("([a-z])'([A-Z])", lambda m: m.group(0).lower(), value.title())
     252    t = re.sub("([a-z])'([A-Z])", lambda m: m.group(0).lower(), value.title())
     253    return re.sub("\d([A-Z])", lambda m: m.group(0).lower(), t)
    253254title.is_safe = True
    254255title = stringfilter(title)
    255256
Back to Top