Skip to content

Commit

Permalink
fix(markdown): generate depth field in TOC for h5 & h6 (#1296)
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Jun 27, 2022
1 parent 514e5cc commit 0396252
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/markdown-parser/toc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { flattenNode, flattenNodeText } from './utils/ast'

const TOC_TAGS = ['h2', 'h3', 'h4', 'h5', 'h6']

const TOC_TAGS_DEPTH = ['h2', 'h3', 'h4'].reduce((tags: any, tag: string) => {
const TOC_TAGS_DEPTH = TOC_TAGS.reduce((tags: any, tag: string) => {
tags[tag] = Number(tag.charAt(tag.length - 1))
return tags
}, {})
Expand Down

0 comments on commit 0396252

Please sign in to comment.