fix webfetch

This commit is contained in:
Dax Raad
2025-06-05 15:59:09 -04:00
parent ea9dd4e9e2
commit 9147108675
3 changed files with 19 additions and 6 deletions

View File

@@ -99,6 +99,13 @@ function extractTextFromHTML(html: string): string {
}
function convertHTMLToMarkdown(html: string): string {
const turndownService = new TurndownService()
const turndownService = new TurndownService({
headingStyle: "atx",
hr: "---",
bulletListMarker: "-",
codeBlockStyle: "fenced",
emDelimiter: "*",
})
turndownService.remove(["script", "style", "meta", "link"])
return turndownService.turndown(html)
}