Ticket #11972: title_filter_ordinal_patch.diff
File title_filter_ordinal_patch.diff, 536 bytes (added by , 15 years ago) |
---|
-
defaultfilters.py
249 249 250 250 def title(value): 251 251 """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) 253 254 title.is_safe = True 254 255 title = stringfilter(title) 255 256