Fix: "Chapter 5: - Fun!" -> "Chapter 5: Fun!"
authorNiki Roo <niki@nikiroo.be>
Tue, 25 Apr 2017 19:19:28 +0000 (21:19 +0200)
committerNiki Roo <niki@nikiroo.be>
Tue, 25 Apr 2017 19:19:28 +0000 (21:19 +0200)
src/be/nikiroo/fanfix/supported/BasicSupport.java

index 471147ea0548ede456aa66e01a6337c9ae4ef1ef..0de0c4aa1eae107550b3266ed23820d558d830b9 100644 (file)
@@ -593,7 +593,8 @@ public abstract class BasicSupport {
        protected Chapter makeChapter(URL source, int number, String name,
                        String content, Progress pg) throws IOException {
                // Chapter name: process it correctly, then remove the possible
-               // redundant "Chapter x: " in front of it
+               // redundant "Chapter x: " in front of it, or "-" (as in
+               // "Chapter 5: - Fun!" after the ": " was automatically added)
                String chapterName = processPara(name).getContent().trim();
                for (String lang : Instance.getConfig().getString(Config.CHAPTER)
                                .split(",")) {
@@ -611,7 +612,7 @@ public abstract class BasicSupport {
                                        Integer.toString(number).length()).trim();
                }
 
-               if (chapterName.startsWith(":")) {
+               while (chapterName.startsWith(":") || chapterName.startsWith("-")) {
                        chapterName = chapterName.substring(1).trim();
                }
                //