mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
Identify markdown headings by any whitespace character after ^#+
Previously only markdown headings with space characters after # would be considered a heading. So ^##\t wouldn't be considered a valid heading
This commit is contained in:
parent
010486fb36
commit
1baebb8d0e
1 changed files with 1 additions and 1 deletions
|
@ -146,7 +146,7 @@ class MarkdownToEntries(TextToEntries):
|
|||
else:
|
||||
entry_filename = str(Path(raw_filename))
|
||||
|
||||
heading = parsed_entry.splitlines()[0] if re.search("^#+\s", parsed_entry) else ""
|
||||
heading = parsed_entry.splitlines()[0] if re.search(r"^#+\s", parsed_entry) else ""
|
||||
# Append base filename to compiled entry for context to model
|
||||
# Increment heading level for heading entries and make filename as its top level heading
|
||||
prefix = f"# {entry_filename}\n#" if heading else f"# {entry_filename}\n"
|
||||
|
|
Loading…
Reference in a new issue