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 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue