美文网首页
DjangoUeditor自动追加标签

DjangoUeditor自动追加标签

作者: 倪大头 | 来源:发表于2018-07-10 16:04 被阅读12次

在django项目中使用百度的富文本编辑器时会自动追加标签,导致html页面引用时页面混乱


屏幕快照 2018-07-10 下午4.02.29.png

上图的文字自动追加了<p>标签

解决方法是在前端引用时加入|safe:

<span style="...">{{ blog.content |safe }}</span>
屏幕快照 2018-07-10 下午4.04.08.png

相关文章

网友评论

      本文标题:DjangoUeditor自动追加标签

      本文链接:https://www.haomeiwen.com/subject/uyxqpftx.html