H
H
hawkkoff2014-07-31 14:26:02
HTML
hawkkoff, 2014-07-31 14:26:02

Instead of html tags, special characters are displayed, who met? How to fix?

Good afternoon

I use Flask, and I output some of the information to the web page from sqlite3 to the template already with html markup, but when outputting < and > are replaced by special characters, although the rest of the template is displayed normally. Tell me what to do? In which direction to dig?

More information

Template:

{% extends "layout.html" %}

{% block content %}
    <div class="col-md-1">
      {{description}}
    </div>
{% endblock %}

The content of the database, which is displayed in {{description}}
<p>бла бла бла</p>
I get:
<div class="col-md-1">
      &lt;p&gt;бла бла бла&lt;/p&gt;
    </div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2014-07-31
@hawkkoff

All reasonable templating engines by default escape what is passed to them for output (to avoid CSRF). Accordingly, look for how Jinja 2 disables html escaping .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question