- fixed a bug with the i18n extension that caused the explicit pluralization
block to look up the wrong variable.
+- fixed a limitation in the lexer that made ``{{ foo.0.0 }}`` impossible.
+
Version 2.0
-----------
(codename jinjavitus, released on July 17th 2008)
r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.S)
integer_re = re.compile(r'\d+')
name_re = re.compile(r'\b[a-zA-Z_][a-zA-Z0-9_]*\b')
-float_re = re.compile(r'\d+\.\d+')
+float_re = re.compile(r'(?<!\.)\d+\.\d+')
newline_re = re.compile(r'(\r\n|\r|\n)')
# bind operators to token types
BOOL = '''{{ true and false }}|{{ false or true }}|{{ not false }}'''
GROUPING = '''{{ (true and false) or (false and true) and not false }}'''
CONDEXPR = '''{{ 0 if true else 1 }}'''
-DJANGOATTR = '''{{ [1, 2, 3].0 }}'''
+DJANGOATTR = '''{{ [1, 2, 3].0 }}|{{ [[1]].0.0 }}'''
FILTERPRIORITY = '''{{ "foo"|upper + "bar"|upper }}'''
TUPLETEMPLATES = [
'{{ () }}',
def test_django_attr(env):
tmpl = env.from_string(DJANGOATTR)
- assert tmpl.render() == '1'
+ assert tmpl.render() == '1|1'
def test_conditional_expression(env):