fix: 删除段落的错误
This commit is contained in:
parent
c4d410073c
commit
089a7afa7e
|
@ -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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user