Commit 49b2716a authored by Boris Kocherov's avatar Boris Kocherov

hash computation fixed in convertToRealWorldSchemaPath

parent 550db7a5
...@@ -56,18 +56,22 @@ ...@@ -56,18 +56,22 @@
prev_downl_path = getMaxPathInDict(map, path); prev_downl_path = getMaxPathInDict(map, path);
if (prev_downl_path === undefined) { if (prev_downl_path === undefined) {
url = ""; url = "";
max_len = 1; max_len = 0;
} else { } else {
url = map[prev_downl_path]; url = map[prev_downl_path];
max_len = prev_downl_path.length; if (prev_downl_path === "/") {
max_len = 0;
} else {
max_len = prev_downl_path.length;
}
} }
hash = path.substr(max_len - 1); hash = path.substr(max_len);
if (hash) { if (hash) {
// XXX urlencode for hash // XXX urlencode for hash
if (url.indexOf("#") >= 0) { if (url.indexOf("#") >= 0) {
url = url + hash; url = url + hash;
} else { } else {
url = url + "#" + path.substr(max_len - 1); url = url + "#" + hash;
} }
} }
return url; return url;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment