@cloud411716/fancy-webnovel 4.26.0 → 4.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -363,10 +363,17 @@ function renderQidianMarkdown(rankLabel, url, books) {
|
|
|
363
363
|
lines.push(`- **打赏:** 今日 ${t} / 本周 ${w}`);
|
|
364
364
|
}
|
|
365
365
|
if (b.intro) {
|
|
366
|
-
//
|
|
367
|
-
//
|
|
368
|
-
//
|
|
369
|
-
|
|
366
|
+
// 格式与其它字段保持一致:首段紧跟标签,其余行各自缩进。
|
|
367
|
+
//
|
|
368
|
+
// 起点桌面页的 #book-intro-detail 会把作者原文里的 \n\n 段落压成
|
|
369
|
+
// 单个 <br>。例如《凡人:聚宝盆里出灵石》的移动端 desc 每句之间都是
|
|
370
|
+
// \n\n,但 https://www.qidian.com/book/1051335496/ 页面上只换行、不空行。
|
|
371
|
+
// 扫描结果以页面展示为准,先把段间空行压成单换行,再交给公共渲染函数,
|
|
372
|
+
// 这样简介只会出现段内硬换行,不会多出空行。
|
|
373
|
+
const intro = (Array.isArray(b.intro) ? b.intro.join('\n') : String(b.intro))
|
|
374
|
+
.replace(/\r\n?/g, '\n')
|
|
375
|
+
.replace(/\n(?:[ \t ]*\n)+/g, '\n');
|
|
376
|
+
lines.push(...renderIntroLines(intro));
|
|
370
377
|
}
|
|
371
378
|
if (b.url) lines.push(`- [作品页](${b.url})`);
|
|
372
379
|
lines.push('', '---', '');
|