Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pystache_custom
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pystache_custom
Commits
18d62861
Commit
18d62861
authored
Jan 01, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed implicit iterators not working.
parent
7e65bb6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
pystache/renderengine.py
+14
-4
No files found.
pystache/renderengine.py
View file @
18d62861
...
...
@@ -366,7 +366,16 @@ class Template(object):
self
.
template
=
template
def
_compile_regexps
(
self
):
tags
=
{
'otag'
:
re
.
escape
(
self
.
otag
),
'ctag'
:
re
.
escape
(
self
.
ctag
)}
# The possible tag type characters following the opening tag,
# excluding "=" and "{".
tag_types
=
"!>&/#^"
# TODO: are we following this in the spec?
#
# The tag's content MUST be a non-whitespace character sequence
# NOT containing the current closing delimiter.
#
tag
=
r"""
(?P<content>[\s\S]*?)
(?P<whitespace>[\ \t]*)
...
...
@@ -374,11 +383,12 @@ class Template(object):
(?:
(?P<change>=) \s* (?P<delims>.+?) \s* = |
(?P<raw>{) \s* (?P<raw_name>.+?) \s* } |
(?P<tag>
\W
?) \s* (?P<name>[\s\S]+?)
(?P<tag>
[
%(tag_types)
s]
?) \s* (?P<name>[\s\S]+?)
)
\s*
%(ctag)
s
"""
self
.
tag_re
=
re
.
compile
(
tag
%
tags
,
re
.
M
|
re
.
X
)
"""
%
{
'tag_types'
:
tag_types
,
'otag'
:
re
.
escape
(
self
.
otag
),
'ctag'
:
re
.
escape
(
self
.
ctag
)}
self
.
tag_re
=
re
.
compile
(
tag
,
re
.
M
|
re
.
X
)
def
to_unicode
(
self
,
text
):
return
unicode
(
text
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment