fix: 删除段落的错误

This commit is contained in:
liuweiqing 2024-02-13 15:30:12 +08:00
parent c4d410073c
commit 089a7afa7e
2 changed files with 2 additions and 2 deletions

View File

@ -163,7 +163,7 @@ async function fetchPubMedData(query: string, year: number, limit: number) {
}
} catch (error) {
//这里无法起作用因为pubmed不会返回400系错误
throw new Error(`未搜索到文献: ${error}`);
throw new Error(`pubmed: ${error}`);
}
}

View File

@ -106,7 +106,7 @@ function removeParagraphWithReference(
if (startIndex === -1) {
return htmlString;
}
const paragraphTag = "<p><br></p>";
const paragraphTag = "</p><p>";
// 向前找到<p><br></p>作为段落的开始标志
let startParagraphIndex = htmlString.lastIndexOf(paragraphTag, startIndex);
if (startParagraphIndex !== -1) {