-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extra line feeds #2
Comments
I think the difference is that other mustache parsers treat a {{# }} strip the trailing linefeed when its on a line by itself For example this produces what I want
|
To be more specific
<html>
<head>
</head>
<body>
{{#scripts}}
<script src="{{name}}"></script>
{{/scripts}}
</body>
</html>
<html>
<head>
</head>
<body>
<script src="A"></script>
<script src="B"></script>
<script src="C"></script>
</body>
</html> |
But in Stache
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script src="A"></script>
<script src="B"></script>
<script src="C"></script>
</body>
</html> |
I also verified this with Mustache python so it would be nice if Stache were consistent with the other implementations. I really like the fact that stache is just one file so I can easily include it as a dependency and I also like the additional features. The {{.}} especially |
I keep forgetting to dig into this, I have some notes/workarounds that are Stache specific:
Output:
Versus:
|
https://github.com/SmithSamuelM/staching fork has a fix for this, changing the above test case import to:
results in:
Versus:
|
Fix appears to be:
|
Extracted code from SmithSamuelM@f2c591e NOTE this no longer passes test suite as test suite is white space sensitive, the test suite has not been updated. The test suite stops on failure, more testing needed.
Working test suite to match previous test, adds a new test for with and without white space.
the following template fragment renders differently in Stache than in others such as pystache, mustache
In pystache each script element is on a separate line
in Stache there is an extra line feed between each script element line
The text was updated successfully, but these errors were encountered: