fix: 章节内容存在多张图片和文本时,web服务书架中读书无法正确渲染图片 (#5125)

Co-authored-by: 17683954109@163.com <17683954109@163.com>
This commit is contained in:
PanicNotPanic
2025-06-05 21:40:27 +08:00
committed by GitHub
co-authored by 17683954109@163.com <17683954109@163.com>
parent 452dfef95b
commit dfc9ff9b31
+5
View File
@@ -305,6 +305,11 @@ const getContent = (index: number, reloadChapter = true, chapterPos = 0) => {
if (res.data.isSuccess) {
const data = res.data.data
const content = data.split(/\n+/)
for (let i = 0; i < content.length; i++) {
if (!/^\s*<img[^>]*src[^>]+>$/.test(content[i])) {
content[i] = content[i].replaceAll('img src="', `img src="/image?url=${bookUrl}&path=`);
}
}
chapterData.value.push({ index, content, title })
if (reloadChapter) toChapterPos(chapterPos)
} else {