File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
packages/pliny/src/mdx-plugins Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' pliny ' : patch
3+ ---
4+
5+ fix toc slugs are tracked across documents
Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ import GithubSlugger from 'github-slugger'
66import { toString } from 'mdast-util-to-string'
77import { remark } from 'remark'
88
9- const slugger = new GithubSlugger ( )
10-
119export type TocItem = {
1210 value : string
1311 url : string
@@ -20,6 +18,7 @@ export type Toc = TocItem[]
2018 * Extracts TOC headings from markdown file and adds it to the file's data object.
2119 */
2220export function remarkTocHeadings ( ) {
21+ const slugger = new GithubSlugger ( )
2322 return ( tree : Parent , file : VFile ) => {
2423 const toc : Toc = [ ]
2524 visit ( tree , 'heading' , ( node : Heading ) => {
You can’t perform that action at this time.
0 commit comments