(html: string)
| 206 | } |
| 207 | |
| 208 | export function convertHTMLToMarkdown(html: string) { |
| 209 | const turndown = new TurndownService({ |
| 210 | headingStyle: "atx", |
| 211 | hr: "---", |
| 212 | bulletListMarker: "-", |
| 213 | codeBlockStyle: "fenced", |
| 214 | emDelimiter: "*", |
| 215 | }) |
| 216 | turndown.remove(["script", "style", "meta", "link"]) |
| 217 | return turndown.turndown(html) |
| 218 | } |