Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cc98f56

Browse filesBrowse files
mixj93QingWei-Li
authored andcommitted
fix: {docsify-ignore-all} and {docsify-ignore} bug (docsifyjs#299)
* fix {docsify-ignore-all} not work bug * fix {docsify-ignore} bug
1 parent 752f68e commit cc98f56
Copy full SHA for cc98f56

2 files changed

+7-6Lines changed: 7 additions & 6 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎docs/more-pages.md‎

Copy file name to clipboardExpand all lines: docs/more-pages.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ This header won't appear in the sidebar table of contents.
8383
To ignore all headers on a specific page, you can use `{docsify-ignore-all}` on the first header of the page.
8484

8585
```markdown
86-
# Getting Started
86+
# Getting Started {docsify-ignore-all}
8787

88-
## Header {docsify-ignore-all}
88+
## Header
8989
This header won't appear in the sidebar table of contents.
9090
```
9191

Collapse file

‎src/core/render/compiler.js‎

Copy file name to clipboardExpand all lines: src/core/render/compiler.js
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,12 @@ export class Compiler {
191191
const currentPath = this.router.getCurrentPath()
192192
const { cacheTree, toc } = this
193193

194-
toc[0] && toc[0].ignoreAllSubs && (this.toc = [])
194+
toc[0] && toc[0].ignoreAllSubs && toc.splice(0)
195195
toc[0] && toc[0].level === 1 && toc.shift()
196-
toc.forEach((node, i) => {
197-
node.ignoreSubHeading && toc.splice(i, 1)
198-
})
196+
197+
for (let i = 0; i < toc.length; i++) {
198+
toc[i].ignoreSubHeading && toc.splice(i, 1) && i--
199+
}
199200

200201
const tree = cacheTree[currentPath] || genTree(toc, level)
201202

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.