gpt-4.1-mini-2025-04-14· OpenAI
WildChat-4.8M (AI2)
how to correct the newlines between each section regardless of if loop condition true or…
- User
how to correct the newlines between each section regardless of if loop condition true or false
code**Dependency Descriptions:** ``` {{dependency_descriptions}} ``` {% if clarifier_info|length > 0 %} **User Provided Info** ``` {{clarifier_info}} ``` {% endif %} {% if global_variables_and_custom_objects|length > 0 %} **Global Variables and Custom Objects:** ```python {{global_variables_and_custom_objects}} ``` {% endif %} **Scenario functions:** ``` {{scenario_functions}} ``` - Assistant
To ensure consistent newlines (spacing) between each section regardless of whether the
{% if %}conditions are true or false, you should include the newlines outside of the conditional blocks. This way, the spacing is always present whether or not the content inside the block renders.Here's how you can adjust your template for consistent spacing:
jinja**Dependency Descriptions:**{{dependency_descriptions}}
code{% if clarifier_info|length > 0 %} **User Provided Info:**