Answer the question
In order to leave comments, you need to log in
How to split a line in html using python?
description= (
"Примеры:"
"Пример 1"
"Пример 2"
)
Примеры:
Пример 1
Пример 2
Примеры: Пример 1 Пример 2
Answer the question
In order to leave comments, you need to log in
description= (
"Примеры:<br/>"
"Пример 1<br/>"
"Пример 2<br/>"
)
{{ description|safe }}
Auto-escaping is the automatic escaping of special characters. The special characters in HTML (and also in XML and XHTML) are &, >, <, ", and '. Since these characters have special meaning in documents, they must be replaced by so-called "entities" for use in text. If not to do this, this can not only affect the user's inability to use these characters, but also lead to security problems (see xss).However
, sometimes in templates it may be necessary to disable auto-escaping.This may be necessary if you want to explicitly insert an HTML fragment into the pages if the snippet came from a secure HTML generation system, such as a markdown to HTML converter There
are three ways to achieve this:
In Python code, wrap an HTML string in a Markup object before passing it to the template. This is the recommended way.
Inside a template, using the |safe filter to explicitly mark a string as safe HTML ({{ myvariable|safe }})
Temporarily disable the auto-escaping system.
To disable the auto-escaping system in templates, you can use the {% autoescape %} block:
{% autoescape false %}
<p>autoescaping is disabled here
<p>{{ will_not_be_escaped }}
{% endautoescape %}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question