From 039625273bf18e4cbaece1d57f522238086eea2a Mon Sep 17 00:00:00 2001 From: Ahad Birang Date: Mon, 27 Jun 2022 23:12:59 +0200 Subject: [PATCH] fix(markdown): generate depth field in TOC for h5 & h6 (#1296) --- src/runtime/markdown-parser/toc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/markdown-parser/toc.ts b/src/runtime/markdown-parser/toc.ts index dd5aa08cc..4ef26a3ad 100644 --- a/src/runtime/markdown-parser/toc.ts +++ b/src/runtime/markdown-parser/toc.ts @@ -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 }, {})