Skip to content

Commit c9e03be

Browse files
committed
fix bus
1 parent b4edd0d commit c9e03be

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ npm test
132132
* 2.7.4 disable console
133133
* 2.7.7 fix bugs
134134
* 2.9.5 featuring collapsible lists
135-
* 2.9.6 update readme
135+
* 2.9.6 update readme
136+
* 2.9.7 fix bugs
136137

137138
### :fuelpump: How to contribute
138139

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ const pageTreeview = module.exports = {
292292

293293
if (levelTab[i - nullCount] < levelTab[i + 1 - nullCount]) {
294294
/** it means that it's a current node */
295-
parentNodes.push(i);
295+
parentNodes.push(i - nullCount);
296296
}
297297

298298
res.push(tabs + '- [' + title + '](#' + href + ')');
@@ -316,6 +316,7 @@ const pageTreeview = module.exports = {
316316
var node = null;
317317
var currentNodeIndex = 0;
318318
var regex = /<i[\s\S]+?<\/i>/g;
319+
319320
while (node = regex.exec(generatedHTML)) {
320321
if (node.index === regex.lastIndex) {
321322
/** Don't let browsers get stuck in an infinite loop */
@@ -340,7 +341,6 @@ const pageTreeview = module.exports = {
340341
+ '} else {'
341342
+ ' list.style.display = \'block\';'
342343
+ '}'
343-
+ ''
344344
+ '"'
345345
+ generatedHTML.substring(node.index + seperatorIndex);
346346
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gitbook-plugin-page-treeview",
3-
"version": "2.9.6",
3+
"version": "2.9.7",
44
"description": "a gitbook plugin for generating a treeview of each page",
55
"engines": {
66
"gitbook": ">=3.0.0-pre.0"

0 commit comments

Comments
 (0)