The title filter will now correctly lowercase the non first letter
like the regular Python filter does.
This fixes #251.
- Fixed some warnings with hashing of undefineds and nodes if Python
is run with warnings for Python 3.
- Added support for properly hashing undefined objects.
+- Fixed a bug with the title filter not working on already uppercase
+ strings.
Version 2.7
-----------
for item in re.compile(r'([-\s]+)(?u)').split(s):
if not item:
continue
- rv.append(item[0].upper() + item[1:])
+ rv.append(item[0].upper() + item[1:].lower())
return ''.join(rv)
assert tmpl.render() == "Foo-Bar"
tmpl = env.from_string('''{{ "foo\tbar"|title }}''')
assert tmpl.render() == "Foo\tBar"
+ tmpl = env.from_string('''{{ "FOO\tBAR"|title }}''')
+ assert tmpl.render() == "Foo\tBar"
def test_truncate(self):
tmpl = env.from_string(