mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
make titles in markdown not be splited with following content (#2971)
### What problem does this PR solve? #2970 ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -168,8 +168,12 @@ class Markdown(MarkdownParser):
|
||||
sections.append((sec[:int(len(sec) / 2)], ""))
|
||||
sections.append((sec[int(len(sec) / 2):], ""))
|
||||
else:
|
||||
sections.append((sec, ""))
|
||||
print(tables)
|
||||
if sections and sections[-1][0].strip().find("#") == 0:
|
||||
sec_, _ = sections.pop(-1)
|
||||
sections.append((sec_+"\n"+sec, ""))
|
||||
else:
|
||||
sections.append((sec, ""))
|
||||
|
||||
for table in tables:
|
||||
tbls.append(((None, markdown(table, extensions=['markdown.extensions.tables'])), ""))
|
||||
return sections, tbls
|
||||
|
||||
Reference in New Issue
Block a user