Skip to content

Commit

Permalink
Fix 'endswith' error (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsquizz authored Dec 16, 2024
1 parent c418b19 commit 50d4d7b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions connectors/db/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,11 @@ def extract_text(self):
if self.full_path.endswith(".md"):
return _process_md(self.content, url=self.citation_url)

if self.full_path.endswith(".txt", ".rst"):
return self.content

if self.full_path.endswith(".adoc"):
return _adoc_to_md(os.path.basename(self.full_path), self.content)

if self.full_path.endswith(".txt") or self.full_path.endswith(".rst"):
return self.content

log.error("cannot extract text for unsupported file type: %s", self.full_path)
return ""

0 comments on commit 50d4d7b

Please sign in to comment.