Support for code files parse (#789)

### What problem does this PR solve?

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
dashi6174
2024-05-15 16:34:28 +08:00
committed by GitHub
parent 12b4c5668c
commit 6ff63ee2ba
2 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,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|md)$", filename, re.IGNORECASE):
elif re.search(r"\.(txt|md|py|js|java|c|cpp|h|php|go|ts|sh|cs|kt)$", filename, re.IGNORECASE):
callback(0.1, "Start to parse.")
txt = ""
if binary: