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
9613e386
Commit
9613e386
authored
Dec 31, 2011
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed tagPos to match_index.
parent
e4175d4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
pystache/template.py
+4
-4
No files found.
pystache/template.py
View file @
9613e386
...
...
@@ -165,11 +165,11 @@ class Template(object):
# Save the literal text content.
buffer
.
append
(
captures
[
'content'
])
end_index
=
match
.
end
()
tagPos
=
match
.
end
(
'content'
)
match_index
=
match
.
end
(
'content'
)
# Standalone (non-interpolation) tags consume the entire line,
# both leading whitespace and trailing newline.
tagBeganLine
=
not
tagPos
or
template
[
tagPos
-
1
]
in
[
'
\r
'
,
'
\n
'
]
tagBeganLine
=
not
match_index
or
template
[
match_index
-
1
]
in
[
'
\r
'
,
'
\n
'
]
tagEndedLine
=
(
end_index
==
len
(
template
)
or
template
[
end_index
]
in
[
'
\r
'
,
'
\n
'
])
interpolationTag
=
captures
[
'tag'
]
in
[
''
,
'&'
,
'{'
]
...
...
@@ -180,7 +180,7 @@ class Template(object):
end_index
+=
template
[
end_index
]
==
'
\n
'
and
1
or
0
elif
captures
[
'whitespace'
]:
buffer
.
append
(
captures
[
'whitespace'
])
tagPos
+=
len
(
captures
[
'whitespace'
])
match_index
+=
len
(
captures
[
'whitespace'
])
captures
[
'whitespace'
]
=
''
name
=
captures
[
'name'
]
...
...
@@ -202,7 +202,7 @@ class Template(object):
tag
=
{
'#'
:
sectionTag
,
'^'
:
inverseTag
}[
captures
[
'tag'
]]
buffer
.
append
(
tag
(
name
,
bufr
,
tmpl
,
(
self
.
otag
,
self
.
ctag
)))
elif
captures
[
'tag'
]
==
'/'
:
raise
EndOfSection
(
buffer
,
template
[
start_index
:
tagPos
],
end_index
)
raise
EndOfSection
(
buffer
,
template
[
start_index
:
match_index
],
end_index
)
elif
captures
[
'tag'
]
in
[
'{'
,
'&'
]:
buffer
.
append
(
unescapedTag
(
name
,
(
self
.
otag
,
self
.
ctag
)))
elif
captures
[
'tag'
]
==
''
:
...
...
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