Skip to content

Commit b770467

Browse files
committed
feat: cleanup
1 parent 5d523b0 commit b770467

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

src/format/headings.ts

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -128,33 +128,10 @@ export function linkify_headings(): Transformer {
128128
const children = (to_hast(node) as Parent).children;
129129

130130
if (!node.data) node.data = {};
131-
if (!node.data.hProperties) node.data.hProperties = {
132-
id: slug
133-
};
131+
if (!node.data.hProperties) node.data.hProperties = {};
134132
if (!node.data.hChildren) node.data.hChildren = [];
135133

136-
// const span_node = {
137-
// type: "element",
138-
// tagName: "span",
139-
// properties: { id: [slug], className: ["offset-anchor"] },
140-
// };
141-
142-
// const a_node = {
143-
// type: "element",
144-
// tagName: "a",
145-
// properties: {
146-
// href: `${data.dir}#${slug}`,
147-
// className: ["anchor"],
148-
// "aria-hidden": true,
149-
// },
150-
// };
151-
152-
// if (node.depth > data.base_level + 1)
153-
// //@ts-ignore
154-
// span_node.properties["data-scrollignore"] = true;
155-
156-
// node.data.hChildren = [span_node, a_node];
157-
134+
node.data.hProperties.id = slug;
158135
children.forEach((v) => node.data.hChildren.push(v));
159136
});
160137
};

0 commit comments

Comments
 (0)