'更新readme'

This commit is contained in:
eric
2026-03-08 22:24:33 -05:00
parent 3c9ef24c54
commit ade21e076f
4 changed files with 95 additions and 99 deletions

View File

@@ -33,7 +33,7 @@ export function parseEbookMarkdown(source: string): EbookData {
}
const chunks: EbookChunk[] = rawChunks.map((chunkHtml) => {
const imgCount = (chunkHtml.match(/<img /g) || []).length;
const imgCount = (chunkHtml.match(/<img\b/g) || []).length;
const textLen = chunkHtml.replace(/<[^>]+>/g, "").length;
const estimatedHeight = Math.max(300, Math.round(textLen * 0.6 + imgCount * 350));
return { html: chunkHtml, estimatedHeight };