Skip to content

Commit

Permalink
Update mdx-compiler-plugin.js
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Oct 18, 2019
1 parent 4c54871 commit 766f013
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions addons/docs/src/mdx/mdx-compiler-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ const startsWithNumber = name => /^\d/.exec(name);

const sanitizeName = name => {
let key = camelCase(name);
if (isReserved(key)) {
key = `${key}Story`;
}
if (startsWithNumber(key)) {
key = `_${key}`;
} else if (isReserved(key)) {
key = `${key}Story`;
}
return key;
};
Expand Down

0 comments on commit 766f013

Please sign in to comment.