small improvement of getHumanReadableIdFromPath()

This commit is contained in:
kelson42 2012-04-23 11:15:32 +00:00
parent b8a13ede0a
commit d00142d1cd
1 changed files with 7 additions and 4 deletions

View File

@ -61,10 +61,13 @@ namespace kiwix {
std::string Book::getHumanReadableIdFromPath() { std::string Book::getHumanReadableIdFromPath() {
std::string id = path; std::string id = path;
removeAccents(id); if (!id.empty()) {
replaceRegex(id, "", "^.*/"); removeAccents(id);
replaceRegex(id, "", "\\.zim[a-z]*$"); replaceRegex(id, "", "^.*/");
replaceRegex(id, "_", " "); replaceRegex(id, "", "\\.zim[a-z]*$");
replaceRegex(id, "_", " ");
replaceRegex(id, "plus", "\\+");
}
return id; return id;
} }