Skip to content

Commit

Permalink
fix(transformer): demo id conflict between different locales
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Jan 19, 2021
1 parent 4a0e33f commit 00dbc05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/preset-dumi/src/transformer/remark/previewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function getPreviewerId(yaml: any, mdAbsPath: string, codeAbsPath: string, compo
const idMap = mdCodeBlockIdMap.get(mdAbsPath);
const prefix =
componentName ||
path.basename(slash(mdAbsPath).replace(/(index|readme)?(\.[\w-]+)?\.md/i, ''));
path.basename(slash(mdAbsPath).replace(/(?:\/(?:index|readme))?(\.[\w-]+)?\.md/i, '$1'));

id = `${prefix}-demo`;

Expand Down

0 comments on commit 00dbc05

Please sign in to comment.