mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-28 05:49:35 +00:00
small improvement of getHumanReadableIdFromPath()
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user