Skip to content

Commit 9597c7c

Browse files
committed
Remove unneeded logic from remark-update-tags
Closes #93 Closes #95 Closes #96 Take one more step toward removing `remark-update-tags`. Don't remove unsupported components or unwrap their children, since these were already removed from the docs content.
1 parent 2c35bcd commit 9597c7c

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

server/remark-update-tags.ts

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -32,59 +32,6 @@ export default function remarkMigrationUpdateTags(): Transformer {
3232
});
3333
}
3434

35-
// Details
36-
if (isMdxNode(node) && node.name === "Details") {
37-
parent.children[index] = {
38-
type: "mdxJsxFlowElement",
39-
name: "details",
40-
attributes: [],
41-
children: [
42-
{
43-
type: "mdxJsxFlowElement",
44-
name: "summary",
45-
attributes: [],
46-
children: [
47-
{
48-
type: "text",
49-
value: getAttributeValue(node, "title"),
50-
},
51-
],
52-
},
53-
{
54-
type: "mdxJsxFlowElement",
55-
name: "div",
56-
attributes: [],
57-
children: node.children,
58-
},
59-
],
60-
} as MdxJsxElement;
61-
62-
return index; // to traverse children
63-
}
64-
65-
// Unwrap Component
66-
if (
67-
isMdxNode(node) &&
68-
[
69-
"Figure",
70-
"TileSet",
71-
"TileList",
72-
"TileListItem",
73-
"ScopedBlock",
74-
].includes(node.name)
75-
) {
76-
parent.children.splice(index, 1, ...node.children); // unwrap children
77-
78-
return index; // to traverse children
79-
}
80-
81-
// Remove components
82-
if (isMdxNode(node) && ["Icon", "VarList"].includes(node.name)) {
83-
parent.children.splice(index, 1);
84-
85-
return index; // index of the next element to traverse, in this case repeat the same index again
86-
}
87-
8835
// Remove string styles from nodes
8936
if (isMdxNode(node)) {
9037
node.attributes = node.attributes.filter(

0 commit comments

Comments
 (0)