- String line = scan.next();
- if (!inChap && detectChapter(line, number) != null) {
+ if (number == 0 && !line.trim().isEmpty()) {
+ // We found pre-chapter content, we are checking for
+ // Chapter 0 (fake chapter) --> keep the content
+ if (inChap == null)
+ inChap = true;
+ }
+ line = scan.next();
+ if ((inChap == null || !inChap) && detectChapter(line, number) != null) {