1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-15 11:04:29 +02:00

trim and replace spaces in chapter names to always work in commands

This commit is contained in:
Necrodoom
2013-08-13 20:04:02 +03:00
committed by KHobbits
parent 5b94d28f7f
commit 42427e2ee5

View File

@@ -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++;