From 11949f9f2e0471670d987285980ef1b843b4bea1 Mon Sep 17 00:00:00 2001 From: Shaun Date: Mon, 22 Apr 2024 14:43:36 +0800 Subject: [PATCH] feat: support markdown files (#483) parse markdown files as txt ### What problem does this PR solve? support markdown files ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- rag/app/naive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/app/naive.py b/rag/app/naive.py index eb87fca70..62c1df023 100644 --- a/rag/app/naive.py +++ b/rag/app/naive.py @@ -137,7 +137,7 @@ def chunk(filename, binary=None, from_page=0, to_page=100000, excel_parser = ExcelParser() sections = [(excel_parser.html(binary), "")] - elif re.search(r"\.txt$", filename, re.IGNORECASE): + elif re.search(r"\.(txt|md)$", filename, re.IGNORECASE): callback(0.1, "Start to parse.") txt = "" if binary: