Skip to content

Commit

Permalink
fix naviTarget in Chinese
Browse files Browse the repository at this point in the history
  • Loading branch information
tamlok committed Sep 23, 2019
1 parent 1886890 commit 4659308
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 57 deletions.
106 changes: 53 additions & 53 deletions dist/js/viki.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion js/contentworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class ContentWorker extends Worker {
fuzzySearch: this.viki.config.fuzzySearch
});

if (info.naviIndex && info.naviFile === info.target) {
if (info.naviIndex &&
info.naviFile === decodeURIComponent(info.target)) {
navier.render(info.hostPath, info.naviFile, info.naviIndex, true);
} else {
// Otherwise, no need to let navier load target.
Expand Down
2 changes: 1 addition & 1 deletion js/navigationrenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ class NavigationRenderer {
let utils = new Utils();
let basePath = utils.cleanPath(this.naviBase);
let path = utils.cleanPath(p_path);
path = decodeURIComponent(path);
if (!path.startsWith(basePath)) {
return;
}
Expand All @@ -275,7 +276,6 @@ class NavigationRenderer {
return;
}

path = decodeURIComponent(path);
let pathNodes = path.split('/');
this.expandToNode(tree.get_node('#'), pathNodes, 0);
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "viki",
"version": "2.0.0",
"version": "2.0.1",
"description": "A simple Wiki page in Markdown from notebook of VNote.",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down

0 comments on commit 4659308

Please sign in to comment.