Skip to content

Commit 274cdba

Browse files
committed
refactor: remove unused code
1 parent a661ca9 commit 274cdba

File tree

3 files changed

+0
-27
lines changed

3 files changed

+0
-27
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"shiki": "^3.2.1",
5656
"strip-markdown": "^6.0.0",
5757
"unified": "^11.0.5",
58-
"unist-util-visit": "^5.0.0",
5958
"vfile-matter": "^5.0.1"
6059
},
6160
"devDependencies": {

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/remark-parsing.mjs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import withSmartQuotes from "remark-smartypants";
1313
import remarkStringify from "remark-stringify";
1414
import remarkStrip from "strip-markdown";
1515
import { unified } from "unified";
16-
import { visit } from "unist-util-visit";
1716
import { matter } from "vfile-matter";
1817
import { getRemoteImgUrl } from "./remote-mdx-files.mjs";
1918
/**
@@ -36,28 +35,6 @@ function addFrontmatterToVFile() {
3635
return (_, file) => matter(file);
3736
}
3837

39-
export function addTocToVFile() {
40-
return (tree, file) => {
41-
const toc = [];
42-
visit(tree, "element", (node) => {
43-
if (
44-
(node.tagName === "h2" || node.tagName === "h3") &&
45-
node.children[0].value
46-
) {
47-
const title = node.children[0]?.value;
48-
49-
toc.push({
50-
id: node.properties.id,
51-
text: title,
52-
level: Number.parseInt(node.tagName[1], 10),
53-
});
54-
}
55-
});
56-
57-
file.data.toc = toc;
58-
};
59-
}
60-
6138
/**
6239
* Returns the parsed content of a document from its markdown content.
6340
*

0 commit comments

Comments
 (0)