fix: 修复【知识库】语雀导出的word,导入知识库是空白的 #1148

This commit is contained in:
shaohuzhang1 2024-09-20 19:36:13 +08:00 committed by shaohuzhang1
parent b8d1512eca
commit 885ab5410a

View File

@ -110,11 +110,12 @@ class DocSplitHandle(BaseSplitHandle):
def to_md(self, doc, images_list, get_image_id): def to_md(self, doc, images_list, get_image_id):
elements = [] elements = []
for element in doc.element.body: for element in doc.element.body:
if element.tag.endswith('tbl'): tag = str(element.tag)
if tag.endswith('tbl'):
# 处理表格 # 处理表格
table = Table(element, doc) table = Table(element, doc)
elements.append(table) elements.append(table)
elif element.tag.endswith('p'): elif tag.endswith('p'):
# 处理段落 # 处理段落
paragraph = Paragraph(element, doc) paragraph = Paragraph(element, doc)
elements.append(paragraph) elements.append(paragraph)