File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
packages/core/src/mdx-plugins Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' fumadocs-core ' : patch
3+ ---
4+
5+ [ ` remark-npm ` ] Enable ` npm install ` prefix fallback only on old alias
Original file line number Diff line number Diff line change @@ -45,11 +45,16 @@ export function remarkNpm({
4545 return ( tree ) => {
4646 visit ( tree , 'code' , ( node ) => {
4747 if ( ! node . lang || ! aliases . includes ( node . lang ) ) return 'skip' ;
48+ let value = node . value ;
49+
50+ if (
51+ node . lang === 'package-install' &&
52+ ! value . startsWith ( 'npm' ) &&
53+ ! value . startsWith ( 'npx' )
54+ ) {
55+ value = `npm install ${ value } ` ;
56+ }
4857
49- const value =
50- node . value . startsWith ( 'npm' ) || node . value . startsWith ( 'npx' )
51- ? node . value
52- : `npm install ${ node . value } ` ;
5358 const attributes : MdxJsxAttribute [ ] = [
5459 {
5560 type : 'mdxJsxAttribute' ,
You can’t perform that action at this time.
0 commit comments