From f60df2f146dbb998da84728f76903ecae9ed5f0a Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Tue, 25 Apr 2017 21:19:28 +0200 Subject: [PATCH] Fix: "Chapter 5: - Fun!" -> "Chapter 5: Fun!" --- src/be/nikiroo/fanfix/supported/BasicSupport.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/be/nikiroo/fanfix/supported/BasicSupport.java b/src/be/nikiroo/fanfix/supported/BasicSupport.java index 471147e..0de0c4a 100644 --- a/src/be/nikiroo/fanfix/supported/BasicSupport.java +++ b/src/be/nikiroo/fanfix/supported/BasicSupport.java @@ -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(); } // -- 2.27.0