Home > Web Front-end > HTML Tutorial > When the jinja2 template generates pages, a large number of blank lines and spaces will be generated. How to remove them? _html/css_WEB-ITnose

When the jinja2 template generates pages, a large number of blank lines and spaces will be generated. How to remove them? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:51:01
Original
2209 people have browsed it

For example:

{% if xxx %}  # 空行 1something...{% endif %}   # 空行 2              # 空行 3{% if xxx %}  # 空行 4something...{% endif %}   # 空行 5              # 空行 6{% if xxx %}  # 空行 7something...{% endif %}   # 空行 8
Copy after login


Solution:

Add the "-" symbol to the block.
For example:
------
{%- if test -%}
{%- endif -%}

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template