wrap document fragment in the <html> and <body> in order to parse the HTML correctly

This commit is contained in:
Hongbo Wu
2023-07-17 16:14:59 +08:00
parent f9aac2e894
commit 113720caf6

View File

@ -248,7 +248,7 @@ export const parsePreparedContent = async (
if (!article?.textContent && allowRetry) {
const newDocument = {
...preparedDocument,
document: '<html>' + document + '</html>',
document: '<html><body>' + document + '</body></html>', // wrap in body
}
return parsePreparedContent(
url,