django - Django 模板过滤器
问题描述
我应该在 django 模板中使用哪个过滤器,以便以输入的方式显示我的文本,包括所有空格甚至对齐方式(无论是左、右等)例如:我想添加一些关于标题的描述,我想要它是这种形式:
"My my, 2018 is going by so quickly!
Maybe it went by fast because we were too busy loading up on all kinds of yummy food at all the new restaurants that opened up.
As usual, we took the liberty of curating a list of eateries that we think you should not keep waiting.
So, without much further adieu, there’s your Culinary Bucket List For The Rest Of 2018".
目前我的标题描述设置为这种格式:{{value:Linebreaks}}
解决方案
使用内置的 {{value | 安全的}}
推荐阅读
- angular - Angular html不会将数据传递给组件
- arrays - 如何在反应中推送 JSON 对象数组中的项目?
- numpy - 运行 Kmeans 时如何解决“异常:数据必须是一维”错误
- c++ - 如何使用鼠标滚轮修复放大和缩小?
- c++ - 我们可以将非类纯右值 const 转换为 xvalue 吗?
- ruby-on-rails - 如何修复在我邪恶的向导第一步中没有发生的“验证”
- ios - 带委托的初始化:没有更多上下文的表达式类型不明确
- android - 如何从现在开始以字符串形式获取 12 小时时间格式的时间?
- c - 如何修复“对 createList 的未定义引用”
- javascript - Chart.js v2 - 如何在工具提示中设置依赖于数据集的日期格式