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 1ac5b4230e
commit b3cae17cab

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