从数据库中检索数据时,CKEditor在我的Div框中显示html标签

时间:2018-08-20 10:17:29

标签: flask

我遇到了一个问题,其中我从通过CKEditor插入的数据库中获取的数据显示HTML标记而不是实际文本 例 我在CKEditor中输入 “你好,世界” 然后将文本保存在数据库中。How data is stored in database 但是当我尝试检索数据并尝试在div框中打印它时 而不是显示 “ HELLO WORLD”将显示全部内容,并将标签转换为文本

Image if Div box

我该如何解决?

       {% for i in post_and_comments %}
          <div class="row container-class-room post-container card-view mb-4">
            <div class="col-xs-12 col-sm-2 col-md-1 col-lg-1 whatsup">
              <img class="display-center post-profilePic" src="{{url_for('static', filename = 'server/student_profile_pic/student_default.jpg')}}" alt="">
            </div>

            <div class="col-xs-12 col-sm-10 col-md-11 col-lg-11 post-body">


              <!-- drop down butto start -->
              <div class="dropdown">
                <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
                <div class="dropdown-menu" aria-labelledby="dropdownMenu2">
                  <button class="dropdown-item" type="button">Edit</button>
                  <button class="dropdown-item" type="button">Delete</button>
                </div>
              </div>

              <!-- post information start -->
              <strong>My Name</strong>
              <br>
              <i>Posted on 9/8/12</i>
              <hr>
               {{i.wall_post.post}}
              <hr class="line-divider" >
            </div>

          </div>
        {% endfor %}

0 个答案:

没有答案