diff --git a/app/admin_service.py b/app/admin_service.py index 1899002..16e80db 100644 --- a/app/admin_service.py +++ b/app/admin_service.py @@ -57,7 +57,7 @@ def article(): _articles = get_page_articles(_cur_page, _page_size) for article in _articles: # 获取每篇文章的title article.title = article.text.split("\n")[0] - article.content = ''.join(article.text.split("\n")[1:]) + article.content = '
'.join(article.text.split("\n")[1:]) context = { "article_number": _article_number, diff --git a/app/templates/admin_manage_article.html b/app/templates/admin_manage_article.html index 1a07133..272b54e 100644 --- a/app/templates/admin_manage_article.html +++ b/app/templates/admin_manage_article.html @@ -77,7 +77,7 @@ Level: {{text.level }} Date: {{ text.date }} -

{{ text.content }}

+ {{ text.content | safe }} {% endfor %}