- if (prevLineEmpty && detectChapter(line) != null) {
- if (descSkipped) {
- String chapName = Integer.toString(chaps.size());
- int pos = line.indexOf(':');
- if (pos >= 0 && pos + 1 < line.length()) {
- chapName = line.substring(pos + 1).trim();
- }
- final URL value = source;
- final String key = chapName;
- chaps.add(new Entry<String, URL>() {
- public URL setValue(URL value) {
- return null;
- }
-
- public URL getValue() {
- return value;
- }
-
- public String getKey() {
- return key;
- }
- });
- } else {
- descSkipped = true;
+ if (prevLineEmpty && detectChapter(line, chaps.size() + 1) != null) {
+ String chapName = Integer.toString(chaps.size() + 1);
+ int pos = line.indexOf(':');
+ if (pos >= 0 && pos + 1 < line.length()) {
+ chapName = line.substring(pos + 1).trim();