修复部分情况下文档摘要导致文集页响应卡顿的问题

This commit is contained in:
zmister 2022-05-21 21:42:25 +08:00
parent d54976c646
commit ced0cb11bf

View File

@ -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):