Skip to content

Commit

Permalink
fix: relative import of . & .. parsing error (#2191)
Browse files Browse the repository at this point in the history
* fix(loaders): fix relative path (`..`) parsing error

* fix(loaders): fix relative path (`..`) parsing error

* fix(loaders): use regexp instead of start-with
  • Loading branch information
wzc520pyfm authored Aug 29, 2024
1 parent 5116c90 commit 2559335
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/loaders/markdown/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function getDemoSourceFiles(demos: IMdTransformerResult['meta']['demos'] = []) {
}

function isRelativePath(path: string) {
return path.startsWith('./') || path.startsWith('../');
return /^\.{1,2}(?!\w)/.test(path);
}

function emitDefault(
Expand Down

0 comments on commit 2559335

Please sign in to comment.