Skip to content

Commit 691d60c

Browse files
committed
fix: Txt file chapter title detection(Anxcye#107)
1 parent a3a9efd commit 691d60c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
- Feat: Expand the range of custom font size
1111
- Feat: Add volume key page turn switch
1212
- Feat: Add custom Gemini api url
13-
-
13+
- Fix: Android TTS slider value not updating
14+
- Fix: Txt file chapter title detection(#107)
1415
- 新增:扩大自定义字体大小范围
1516
- 新增:音量键翻页开关
1617
- 新增:自定义 Gemini api url
1718
- 修复:Android TTS 滑块数值不更新
19+
- 修复:txt 文件章节标题检测(#107)
1820

1921
## 1.2.6
2022
- Fix: Fix ai stream error

lib/service/convert_to_epub/txt/convert_from_txt.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ Future<File> convertFromTxt(File file) async {
6464
AnxLog.info('convert from txt. content: ${content.length}');
6565

6666
final patternStr = RegExp(
67-
r'^(.* +| *)?([第][一二三四五六七八九十零〇百千万两0123456789]+[章卷]|[卷][一二三四五六七八九十零〇百千万两0123456789]+|[Cc]hap(?:ter)\.?|[Vv]ol(?:ume)?\.?|[Bb]ook|[Bb]k)( +.*)?$',
67+
r'^(?:(.+ +)|())(第[一二三四五六七八九十零〇百千万两0123456789]+[章卷]|[一二三四五六七八九十零〇百千万两0123456789]+|chap(?:ter)\.?|vol(?:ume)?\.?|book|bk)(?:(?: +.+)?|(?:\S.*)?)$',
6868
multiLine: true,
69+
caseSensitive: false,
6970
);
7071

7172
final matches = patternStr.allMatches(content).toList();

0 commit comments

Comments
 (0)