fix: gracefully handle html2md failure (#2533)

This commit is contained in:
Peter Cardenas
2025-07-26 01:19:38 -07:00
committed by GitHub
parent 53dcb55896
commit d8ec4e4aa4

View File

@@ -21,7 +21,9 @@ function M.fetch_md(url)
local html2md_lib = M._init_html2md_lib()
if not html2md_lib then return nil, "Failed to load avante_html2md" end
return html2md_lib.fetch_md(url)
local ok, res = pcall(html2md_lib.fetch_md, url)
if not ok then return nil, res end
return res, nil
end
return M