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
88f604c6
Commit
88f604c6
authored
Mar 19, 2011
by
Pieter van de Bruggen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing errors relating to Windows-style newlines.
parent
9de38680
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
pystache/template.py
+6
-3
No files found.
pystache/template.py
View file @
88f604c6
...
...
@@ -130,12 +130,15 @@ class Template(object):
# Standalone (non-interpolation) tags consume the entire line,
# both leading whitespace and trailing newline.
tagBeganLine
=
not
tagPos
or
template
[
tagPos
-
1
]
==
'
\n
'
tagEndedLine
=
(
pos
==
len
(
template
)
or
template
[
pos
]
==
'
\n
'
)
tagBeganLine
=
not
tagPos
or
template
[
tagPos
-
1
]
in
[
'
\r
'
,
'
\n
'
]
tagEndedLine
=
(
pos
==
len
(
template
)
or
template
[
pos
]
in
[
'
\r
'
,
'
\n
'
]
)
interpolationTag
=
captures
[
'tag'
]
in
[
''
,
'&'
,
'{'
]
if
(
tagBeganLine
and
tagEndedLine
and
not
interpolationTag
):
pos
+=
1
if
pos
<
len
(
template
):
pos
+=
template
[
pos
]
==
'
\r
'
and
1
or
0
if
pos
<
len
(
template
):
pos
+=
template
[
pos
]
==
'
\n
'
and
1
or
0
elif
captures
[
'whitespace'
]:
buffer
.
append
(
captures
[
'whitespace'
])
tagPos
+=
len
(
captures
[
'whitespace'
])
...
...
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