Comments (6)
I have a similar problem with new lines.
Some templates have for loops and if statements, and they always render a line in the output. Is possible to not render a new line when we have a line, exclusively, with for, endfor, if or endif (at least)?
from jinjava.
@AnakinPt Do you have an example snippet I could use to see what is going on?
from jinjava.
Original template:
Resources:
{% for n in bucketList %}
{{ n.resourceName }}:
Type: 'AWS::S3::Bucket'
Properties:
Generated:
Resources:
LoggingS3Bucket:
Type: 'AWS::S3::Bucket'
Properties:
If you see in the previous code it generates an empty line in the line with the {% for %} loop?
from jinjava.
You can use
{%- for n in bucketList -%}
to strip whitespace.
from jinjava.
Thanks. I'll try it next week.
from jinjava.
worked perfectly, but only with the dash in the beginning. The both will strip other space.
from jinjava.
Related Issues (20)
- Can Dict key be an integer? HOT 2
- CVEs in current version: 2.7.0
- time for 2.7.1 / 2.8.0 ?
- Unexpected behavior comparing empty strings to 0
- Is the expression interpolation recursive? HOT 1
- Problem with using the function in nested interpretation HOT 2
- SnakeYAML 1.27 vulnerability in Jinjava 2.7.1 HOT 1
- Add {% hubl %} tag
- Maps in string representation in Сontext
- Support for "with" statement
- Resolve function with map like contructs HOT 1
- Mixing include and extends does not work
- Fix CVEs in version 2.7.1
- Inconsistent implementation with jinja2 HOT 1
- trouble with coercision in test
- Add support for java records HOT 1
- Rendering template with custom function in Scala throws NullPointerException HOT 4
- [question] receiving fixes flow // GHSA-h75v-3vvj-5mfj CVE-2024-34064 HOT 2
- upgrade commons-net to 3.10.0
- Fix eager execution handling of `{% print foo|render %}`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jinjava.