only remove a fragment part from a file name if it looks like an html
This commit is contained in:
parent
2ee9cb1329
commit
e6ea2ba4dc
1 changed files with 9 additions and 2 deletions
|
@ -562,10 +562,17 @@ string fileurltolocalpath(string url)
|
||||||
url = url.substr(7, string::npos);
|
url = url.substr(7, string::npos);
|
||||||
else
|
else
|
||||||
return string();
|
return string();
|
||||||
|
|
||||||
|
// Removing the fragment part. This is exclusively used when
|
||||||
|
// executing a viewer for the recoll manual, and we only strip the
|
||||||
|
// part after # if it is preceded by .html
|
||||||
string::size_type pos;
|
string::size_type pos;
|
||||||
if ((pos = url.find_last_of("#")) != string::npos) {
|
if ((pos = url.rfind(".html#")) != string::npos) {
|
||||||
url.erase(pos);
|
url.erase(pos+5);
|
||||||
|
} else if ((pos = url.rfind(".htm#")) != string::npos) {
|
||||||
|
url.erase(pos+4);
|
||||||
}
|
}
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue