Merge pull request #177 from MODSetter/dev

fix: Markdown & Text files should be supported as default.
This commit is contained in:
Rohan Verma 2025-07-07 23:01:04 -07:00 committed by GitHub
commit 71e9794da2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View file

@ -138,8 +138,8 @@ async def process_file_in_background(
session: AsyncSession
):
try:
# Check if the file is a markdown file
if filename.lower().endswith(('.md', '.markdown')):
# Check if the file is a markdown or text file
if filename.lower().endswith(('.md', '.markdown', '.txt')):
# For markdown files, read the content directly
with open(file_path, 'r', encoding='utf-8') as f:
markdown_content = f.read()

View file

@ -48,6 +48,8 @@ export default function FileUploader() {
'audio/mp4': ['.mp4', '.m4a'],
'audio/wav': ['.wav'],
'audio/webm': ['.webm'],
'text/markdown': ['.md', '.markdown'],
'text/plain': ['.txt'],
};
// Conditionally set accepted file types based on ETL service
@ -82,7 +84,6 @@ export default function FileUploader() {
'application/vnd.oasis.opendocument.graphics': ['.odg'],
'application/vnd.oasis.opendocument.spreadsheet': ['.ods'],
'application/vnd.oasis.opendocument.formula': ['.fods'],
'text/plain': ['.txt'],
'text/csv': ['.csv'],
'text/tab-separated-values': ['.tsv'],
'text/html': ['.html', '.htm', '.web'],
@ -112,7 +113,6 @@ export default function FileUploader() {
'text/html': ['.html'],
'image/jpeg': ['.jpeg', '.jpg'],
'image/png': ['.png'],
'text/markdown': ['.md', '.markdown'],
'application/vnd.ms-outlook': ['.msg'],
'application/vnd.oasis.opendocument.text': ['.odt'],
'text/x-org': ['.org'],
@ -123,7 +123,6 @@ export default function FileUploader() {
'text/x-rst': ['.rst'],
'application/rtf': ['.rtf'],
'image/tiff': ['.tiff'],
'text/plain': ['.txt'],
'text/tab-separated-values': ['.tsv'],
'application/vnd.ms-excel': ['.xls'],
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': ['.xlsx'],