Skip to content

Commit

Permalink
fix(core): replace all import info in mdx (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
10Derozan authored Mar 1, 2024
1 parent 6665a11 commit f07b64f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/smooth-masks-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rspress/core': patch
---

fix(core): replace all import info in mdx
2 changes: 1 addition & 1 deletion packages/core/src/node/utils/flattenMdxContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export async function flattenMdxContent(
new RegExp(`import\\s+${id}\\s+from\\s+['"](${importPath})['"];?`),
'',
)
.replace(new RegExp(`<${id}\\s*/>`), () => replacedValue);
.replace(new RegExp(`<${id}\\s*/>`, 'g'), () => replacedValue);
}
}

Expand Down

0 comments on commit f07b64f

Please sign in to comment.