mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 上传的文档中 未智能处理空白段落
This commit is contained in:
parent
948d0c4f3c
commit
7eb18fbf30
|
|
@ -332,6 +332,8 @@ class SplitModel:
|
|||
"""
|
||||
result_tree = self.parse_to_tree(text.replace('\r', '\n'), 0)
|
||||
result = result_tree_to_paragraph(result_tree, [], [])
|
||||
# 过滤段落内容不为空字符串的数据
|
||||
result = [item for item in result if 'content' in item and len(item.get('content').strip()) > 0]
|
||||
return [{**item, 'title': item.get('title').replace("#", '') if 'title' in item else ''} for item in result]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue