fix: Move HTML to Markdown conversion to scraper.go

This commit is contained in:
Arik Jones (aider)
2024-09-14 20:55:35 -05:00
parent 939cffb55e
commit c1755836b5
2 changed files with 13 additions and 15 deletions

View File

@@ -174,13 +174,9 @@ func extractAndConvertContent(urlStr string) (string, error) {
}
}
// Create a new converter
converter := md.NewConverter("", true, nil)
// Convert HTML to Markdown
markdown, err := converter.ConvertString(content)
markdown, err := scraper.ProcessHTMLContent(content, scraper.Config{})
if err != nil {
return "", fmt.Errorf("error converting HTML to Markdown: %v", err)
return "", fmt.Errorf("error processing HTML content: %v", err)
}
parsedURL, err := url.Parse(urlStr)