From ced0cb11bf931c089d728cb51a8611685c2e078b Mon Sep 17 00:00:00 2001 From: zmister Date: Sat, 21 May 2022 21:42:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E6=96=87=E6=A1=A3=E6=91=98=E8=A6=81=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=96=87=E9=9B=86=E9=A1=B5=E5=93=8D=E5=BA=94=E5=8D=A1?= =?UTF-8?q?=E9=A1=BF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_doc/views.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app_doc/views.py b/app_doc/views.py index e1e61d6..b30aaf5 100644 --- a/app_doc/views.py +++ b/app_doc/views.py @@ -94,11 +94,13 @@ def remove_markdown_tag(docs): for doc in docs: try: if doc.editor_mode == 3: # 富文本文档 - doc.content = strip_tags(doc.content) + doc.content = strip_tags(doc.content)[:201] + elif doc.editor_mode == 4: + doc.pre_content = "此为表格文档,进入文档查看详细内容" else: # 其他文档 - doc.pre_content = strip_tags(markdown.markdown(doc.pre_content)) + doc.pre_content = strip_tags(markdown.markdown(doc.pre_content))[:201] except Exception as e: - doc.pre_content = doc.pre_content + doc.pre_content = doc.pre_content[:201] # 获取文集的文档目录 def get_pro_toc(pro_id):