Skip to content
Myr

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

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parents ff115c4, b523c93 · Browse files · 3 files+5 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+5 added−6 removed

  • other:+5 added−6 removed

3 files+5 added−6 removed

modified:docs/api.rst+1 added-1 removed
594 unmodified lines
595paragraphs and marks the return value as safe HTML string if autoescaping is596enabled::597598 import re599 from jinja2 import environmentfilter, Markup, escape599 from jinja2 import evalcontextfilter, Markup, escape600601 _paragraph_re = re.compile(r'(?:\r\n|\r|\n){2,}')602603 @evalcontextfilter
187 unmodified lines
modified:docs/templates.rst+3 added-3 removed
42 unmodified lines
4344This covers the default settings. The application developer might have45changed the syntax from ``{% foo %}`` to ``<% foo %>`` or something similar.4647There are two kinds of delimiers. ``{% ... %}`` and ``{{ ... }}``. The first47There are two kinds of delimiters. ``{% ... %}`` and ``{{ ... }}``. The first48one is used to execute statements such as for-loops or assign values, the49latter prints the result of the expression to the template.5051.. _variables:
112 unmodified lines
164165 {% for item in seq -%}166 {{ item }}167 {%- endfor %}168 168169This will yield all elements without whitespace between them. If `seq` was170a list of numbers from ``1`` to ``9`` the output would be ``123456789``.171172If :ref:`line-statements` are enabled they strip leading whitespace
1000 unmodified lines
11731174 .. attribute:: current11751176 Returns the current item.1177 11771178 **new in Jinja 2.1**11791180.. class:: joiner(sep=', ')1181
185 unmodified lines
modified:jinja2/loaders.py+1 added-2 removed
249 unmodified lines
250 def _walk(path):251 for filename in self.provider.resource_listdir(path):252 fullname = path + '/' + filename253 if self.provider.resource_isdir(fullname):254 for item in _walk(fullname):255 results.append(item)254 _walk(fullname)255 else:256 results.append(fullname[offset:].lstrip('/'))257 _walk(path)258 results.sort()
192 unmodified lines