From 64b80f1f5fc376c5dc296b2d9f82d15106a8dcef Mon Sep 17 00:00:00 2001 From: kang Date: Sat, 18 Apr 2026 14:18:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E9=A1=B5=E9=80=82=E9=85=8D=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E9=83=A8=E5=A4=9A=E7=AB=A0=EF=BC=9A=E6=AD=A3=E5=88=99?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=AC=ACN=E7=AB=A0=EF=BC=88=E4=B8=AD?= =?UTF-8?q?=E6=96=87/=E9=98=BF=E6=8B=89=E4=BC=AF=E6=95=B0=E5=AD=97?= =?UTF-8?q?=EF=BC=89+=20CHAPTERS=20=E5=8A=A0=E7=AC=AC=E4=BA=8C=E9=83=A8=20?= =?UTF-8?q?Ch2=20=E6=9D=A1=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - renderNovel 第二部正则从'第一章'写死改为'第.+?章'通用捕获,映射中文数字→01/02... - CHAPTERS 新增 n=-2 第 23 条(第二部 Ch2) - renderChapterList 负 n 值支持'II·01 / II·02'编号 Co-Authored-By: Claude Opus 4.7 (1M context) --- .memory/worklog.json | 7 +++++++ web/index.html | 13 ++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.memory/worklog.json b/.memory/worklog.json index bcbe741..249941d 100644 --- a/.memory/worklog.json +++ b/.memory/worklog.json @@ -328,6 +328,13 @@ "message": "auto-save 2026-04-18 14:13 (~1)", "hash": "b71ec7e", "files_changed": 1 + }, + { + "ts": "2026-04-18T14:17:40+08:00", + "type": "commit", + "message": "第二部 · 第二章《他差一点把那些刺长回来》(+3800 字)", + "hash": "368fcfa", + "files_changed": 3 } ] } diff --git a/web/index.html b/web/index.html index 6582bd5..3ccc223 100644 --- a/web/index.html +++ b/web/index.html @@ -833,6 +833,7 @@ const CHAPTERS = [ { file: 'extra/s2_blank_second_page.jpg', cap: '我 怕 的——', sub: '第二部 · 序章 · 留白' } ] }, { n: -1, title: '另一个看见了的人', img: 'extra/s2_blank_second_page.jpg', volume: '第二部 · 起笔', hint: '沈陌登门:顾先生,我写到这里,就等您告诉我,下面该不该写下去' }, + { n: -2, title: '他差一点把那些刺长回来', img: null, volume: '第二部 · 起笔', hint: '三天读尽白皮书,差一点对一个系统动了信任测试的念头;出门去见了韩锐' }, ]; function renderChapterList() { @@ -845,7 +846,7 @@ function renderChapterList() { } let num; if (ch.n === 0) num = '终'; - else if (ch.n === -1) num = 'II'; + else if (ch.n < 0) num = 'II·' + String(-ch.n).padStart(2, '0'); else num = ch.n.toString().padStart(2, '0'); const title = ch.n === 0 ? ch.title.replace('终章 · ', '') : ch.title; html += ` @@ -944,12 +945,14 @@ function renderNovel(md) { // kicker assigned below var kicker = isEpilogue ? 'EPILOGUE' : 'CHAPTER ' + num; } else { - const m2 = heading.match(/^第二部\s*·\s*第一章\s*·\s*(.+)$/); + const m2 = heading.match(/^第二部\s*·\s*第(.+?)章\s*·\s*(.+)$/); if (!m2) return; isPart2 = true; - num = 'II · 01'; - title = m2[1]; - var kicker = 'PART II · CHAPTER 01'; + const cnMap = { '一': '01', '二': '02', '三': '03', '四': '04', '五': '05', '六': '06', '七': '07', '八': '08', '九': '09', '十': '10' }; + const arabic = cnMap[m2[1]] || m2[1]; + num = 'II · ' + arabic; + title = m2[2]; + var kicker = 'PART II · CHAPTER ' + arabic; } const ch = CHAPTERS[idx]; const imgPath = ch ? `./images/${ch.img}` : '';