Permalink
Browse files

Merge branch 'master' of github.com:mitsuhiko/jinja2

  • Loading branch information...
2 parents de1405f + 147472a commit 73c34f5a998bc0bc058d202fa3e9cee62d5684c5 @mitsuhiko mitsuhiko committed May 31, 2013
Showing with 10 additions and 2 deletions.
  1. +1 −1 jinja2/filters.py
  2. +8 −0 jinja2/testsuite/filters.py
  3. +1 −1 setup.py
View
@@ -183,7 +183,7 @@ def do_title(s):
uppercase letters, all remaining characters are lowercase.
"""
rv = []
- for item in re.compile(r'([-\s]+)(?u)').split(s):
+ for item in re.compile(r'([-\s]+)(?u)').split(soft_unicode(s)):
if not item:
continue
rv.append(item[0].upper() + item[1:])
@@ -205,6 +205,14 @@ def test_title(self):
tmpl = env.from_string('''{{ "foo\tbar"|title }}''')
assert tmpl.render() == "Foo\tBar"
+ class Foo:
+ def __str__(self):
+ return 'foo-bar'
+
+ tmpl = env.from_string('''{{ data|title }}''')
+ out = tmpl.render(data=Foo())
+ assert out == 'Foo-Bar'
+
def test_truncate(self):
tmpl = env.from_string(
'{{ data|truncate(15, true, ">>>") }}|'
View
@@ -80,7 +80,7 @@
'Topic :: Text Processing :: Markup :: HTML'
],
packages=['jinja2', 'jinja2.testsuite', 'jinja2.testsuite.res'],
- install_requires=['markupsafe'],
+ install_requires=['MarkupSafe'],
extras_require={'i18n': ['Babel>=0.8']},
test_suite='jinja2.testsuite.suite',
include_package_data=True,

0 comments on commit 73c34f5

Please sign in to comment.