Skip to content

Commit

Permalink
chore: simplify codes
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jan 11, 2025
1 parent bec2fc1 commit 76cdd98
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions packages/plugin-container-syntax/src/remarkPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,7 @@ function transformer(tree: Parent) {
while (i < tree.children.length) {
const node = tree.children[i];

// The list ast must be traversed to find the container directive,
// especially for the unordered list whose ast is very different
if (node.type === 'list') {
for (const item of node.children) {
transformer(item);
}
} else if (node.type === 'mdxJsxFlowElement') {
if ('children' in node) {
transformer(node);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-container-syntax/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ This is a details block.
> [!TIP]
> This is a 'tip' style block.
`);
`);

expect(result.value).toMatchSnapshot();
});
Expand Down

0 comments on commit 76cdd98

Please sign in to comment.