mirror of https://github.com/kiwix/libkiwix.git
small improvement of getHumanReadableIdFromPath()
This commit is contained in:
parent
b8a13ede0a
commit
d00142d1cd
|
@ -61,10 +61,13 @@ namespace kiwix {
|
|||
|
||||
std::string Book::getHumanReadableIdFromPath() {
|
||||
std::string id = path;
|
||||
removeAccents(id);
|
||||
replaceRegex(id, "", "^.*/");
|
||||
replaceRegex(id, "", "\\.zim[a-z]*$");
|
||||
replaceRegex(id, "_", " ");
|
||||
if (!id.empty()) {
|
||||
removeAccents(id);
|
||||
replaceRegex(id, "", "^.*/");
|
||||
replaceRegex(id, "", "\\.zim[a-z]*$");
|
||||
replaceRegex(id, "_", " ");
|
||||
replaceRegex(id, "plus", "\\+");
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue