Chinese novels commonly use 番外 (bonus), 番外篇, or 外传 as chapter headings, optionally combined with 第N章. The previous regex only matched 第N章 at line start, so lines like "番外 第1章 旗开得胜" were dropped from the TOC. Treat 番外篇/番外/外传 as preface-style keywords so they match alongside 楔子/前言/etc. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -635,7 +635,7 @@ export class TxtToEpubConverter {
|
||||
'(' +
|
||||
[
|
||||
String.raw`第[ 零〇一二三四五六七八九十0-9][ 零〇一二三四五六七八九十百千万0-9]*(?:[章卷节回讲篇封本册部话])(?:[::、 \(\)0-9]*[^\n-]{0,36})(?!\S)`,
|
||||
String.raw`(?:楔子|前言|简介|引言|序言|序章|总论|概论|后记)(?:[:: ][^\n-]{0,36})?(?!\S)`,
|
||||
String.raw`(?:楔子|前言|简介|引言|序言|序章|总论|概论|后记|番外篇|番外|外传)(?:[:: ][^\n-]{0,36})?(?!\S)`,
|
||||
String.raw`chapter[\s.]*[0-9]+(?:[::. ]+[^\n-]{0,50})?(?!\S)`,
|
||||
].join('|') +
|
||||
')',
|
||||
|
||||
Reference in New Issue
Block a user