文章管理页面:每篇文章中保留换行,方便查看。

Lan Hui 2023-03-26 21:14:29 +08:00
parent d4ac709385
commit 0ce1c6eb6e
2 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ def article():
_articles = get_page_articles(_cur_page, _page_size) _articles = get_page_articles(_cur_page, _page_size)
for article in _articles: # 获取每篇文章的title for article in _articles: # 获取每篇文章的title
article.title = article.text.split("\n")[0] article.title = article.text.split("\n")[0]
article.content = ''.join(article.text.split("\n")[1:]) article.content = '<br/>'.join(article.text.split("\n")[1:])
context = { context = {
"article_number": _article_number, "article_number": _article_number,

View File

@ -77,7 +77,7 @@
<small>Level: {{text.level }}</small> <small>Level: {{text.level }}</small>
<small>Date: {{ text.date }}</small> <small>Date: {{ text.date }}</small>
</div> </div>
<p style="padding-top: 5px;" class="mb-1">{{ text.content }}</p> {{ text.content | safe }}
</div> </div>
{% endfor %} {% endfor %}
</div> </div>