mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
18 lines
453 B
TypeScript
18 lines
453 B
TypeScript
import { markdownProcess } from '@fastgpt/global/common/string/markdown';
|
|
import { readFileRawText } from './rawText';
|
|
|
|
export const readMdFile = async ({
|
|
file,
|
|
uploadImgController
|
|
}: {
|
|
file: File;
|
|
uploadImgController?: (base64: string) => Promise<string>;
|
|
}) => {
|
|
const { rawText: md } = await readFileRawText(file);
|
|
const simpleMd = await markdownProcess({
|
|
rawText: md,
|
|
uploadImgController
|
|
});
|
|
return { rawText: simpleMd };
|
|
};
|