From b3cae17cab49e1dc1ea2d9d36ae1518506ea3473 Mon Sep 17 00:00:00 2001 From: Necrodoom Date: Tue, 13 Aug 2013 20:04:02 +0300 Subject: [PATCH] trim and replace spaces in chapter names to always work in commands --- .../src/com/earth2me/essentials/textreader/TextInput.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/textreader/TextInput.java b/Essentials/src/com/earth2me/essentials/textreader/TextInput.java index 31e50421e..d6462d047 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/TextInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/TextInput.java @@ -76,7 +76,7 @@ public class TextInput implements IText if (line.length() > 0 && line.charAt(0) == '#') { bookmarks.put(line.substring(1).toLowerCase(Locale.ENGLISH).replaceAll("&[0-9a-fk]", ""), lineNumber); - chapters.add(line.substring(1).replace('&', '§').replace("§§", "&")); + chapters.add(line.substring(1).replace('&', '§').replace("§§", "&").trim().replace(" ", "_")); } lines.add(line.replace('&', '§').replace("§§", "&")); lineNumber++;