(html: string)
| 180 | } |
| 181 | |
| 182 | function convertHTMLToMarkdown(html: string): string { |
| 183 | const turndownService = new TurndownService({ |
| 184 | headingStyle: "atx", |
| 185 | hr: "---", |
| 186 | bulletListMarker: "-", |
| 187 | codeBlockStyle: "fenced", |
| 188 | emDelimiter: "*", |
| 189 | }) |
| 190 | turndownService.remove(["script", "style", "meta", "link"]) |
| 191 | return turndownService.turndown(html) |
| 192 | } |