Skip to content

Commit f8fa3a1

Browse files
committed
fix(md): 修复toc目录引入标题id不正确(全为undefined)问题
1 parent 018d2f6 commit f8fa3a1

File tree

1 file changed

+2
-2
lines changed
  • packages/devui-vue/devui/editor-md/src/plugins

1 file changed

+2
-2
lines changed

packages/devui-vue/devui/editor-md/src/plugins/toc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ export default function (md: any, options: Record<string, any>) {
5959
let content;
6060
if (heading.children && heading.children.length > 0 && heading.children[0].type === 'link_open') {
6161
content = heading.children[1].content;
62-
heading._toAnchor = safeString(content);
62+
heading._tocAnchor = safeString(content);
6363
} else {
6464
content = heading.content;
65-
heading._toAnchor = safeString(heading.children.reduce((s, t) => s + t.content, ''));
65+
heading._tocAnchor = safeString(heading.children.reduce((s, t) => s + t.content, ''));
6666
}
6767
headings.push({
6868
content,

0 commit comments

Comments
 (0)