Skip to content

Commit b3ce1a5

Browse files
Fix bug (#59)
1 parent 9bd16dc commit b3ce1a5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

adi_function_app/semantic_text_chunker.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ def split_into_sentences(self, text: str) -> list[str]:
174174
# Extend the result with the correctly split parts, retaining \n\n before the heading
175175
for part in split_result:
176176
if part.strip(): # Only add non-empty parts
177+
if (
178+
self.is_markdown_heading(part)
179+
and part.endswith("\n\n") is False
180+
):
181+
part = part + "\n\n"
177182
heading_split_sentences.append(part)
178183

179184
return heading_split_sentences

0 commit comments

Comments
 (0)