chatgpt-api/src/utils.ts

10 wiersze
229 B
TypeScript

import { remark } from 'remark'
import stripMarkdown from 'strip-markdown'
export function markdownToText(markdown?: string): string {
return remark()
.use(stripMarkdown)
.processSync(markdown ?? '')
.toString()
}