mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-30 15:16:45 +08:00
feat: add MDX file support (#12261)
Feat: add MDX file support #12057 ### What problem does this PR solve? <img width="1055" height="270" alt="image" src="https://github.com/user-attachments/assets/a0ab49f9-7806-41cd-8a96-f593591ab36b" /> The page states that MDX files are supported, but uploading fails with the error: "x.mdx: This type of file has not been supported yet!" <img width="381" height="110" alt="image" src="https://github.com/user-attachments/assets/4bbb7d08-cb47-416a-95fc-bc90b90fcc39" /> ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -65,7 +65,10 @@ const ParserListMap = new Map([
|
||||
'knowledge_graph',
|
||||
],
|
||||
],
|
||||
[['md'], ['naive', 'qa', 'knowledge_graph']],
|
||||
[
|
||||
['md', 'mdx'],
|
||||
['naive', 'qa', 'knowledge_graph'],
|
||||
],
|
||||
[['json'], ['naive', 'knowledge_graph']],
|
||||
[['eml'], ['email']],
|
||||
]);
|
||||
|
||||
@ -82,7 +82,7 @@ const Preview = ({
|
||||
<CSVFileViewer className={className} url={url} />
|
||||
</section>
|
||||
)}
|
||||
{['md'].indexOf(fileType) > -1 && (
|
||||
{['md', 'mdx'].indexOf(fileType) > -1 && (
|
||||
<section>
|
||||
<Md className={className} url={url} />
|
||||
</section>
|
||||
|
||||
@ -1028,7 +1028,7 @@ function getFileIcon(file: File) {
|
||||
|
||||
if (
|
||||
type.startsWith('text/') ||
|
||||
['txt', 'md', 'rtf', 'pdf'].includes(extension)
|
||||
['txt', 'md', 'mdx', 'rtf', 'pdf'].includes(extension)
|
||||
) {
|
||||
return <FileTextIcon />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user