mirror of
https://github.com/labring/FastGPT.git
synced 2026-04-27 02:08:10 +08:00
7494ce8453
* perf: async read file * package * doc
15 lines
425 B
TypeScript
15 lines
425 B
TypeScript
import { type ReadRawTextByBuffer, type ReadFileResponse } from '../type';
|
|
import { readFileRawText } from './rawText';
|
|
import { html2md } from '../../htmlStr2Md/utils';
|
|
|
|
export const readHtmlRawText = async (params: ReadRawTextByBuffer): Promise<ReadFileResponse> => {
|
|
const { rawText: html } = await readFileRawText(params);
|
|
|
|
const { rawText, imageList } = html2md(html);
|
|
|
|
return {
|
|
rawText,
|
|
imageList
|
|
};
|
|
};
|