umijs/dumi

bug: menu render unexpect when docs dir path include `enum`

Open

#871 opened on Sep 11, 2021

View on GitHub
 (7 comments) (0 reactions) (0 assignees)JavaScript (1,170 forks)github user discovery
buggood first issuesomeone working on it

Repository metrics

Stars
 (3,793 stars)
PR merge metrics
 (PR metrics pending)

Description

Versions

  • dumi:1.1.26
  • node:14.16.1
  • npm:6.14.12
  • OS:MacBook Pro (13-inch, M1, 2020)
  • Browser:Google Chrome 93.0.4577.63 (arm64)

Steps to reproduce

  1. Create a folder named with enum in the docs directory, like this:
docs
├── docs
│   └── enum
│       ├── ListCard.en.md
│       └── ListCard.md
├── index.en.md
└── index.md

With locale config:

locales: [
  ['zh', '中文'],
  ['en', 'English'],
],
  1. Click locale bar changing current language, enum menu render error:

Living demo: https://saber2pr-umi.github.io/test-dumi-enum/en/docs/enum/list-card

Demo source code: https://github.com/saber2pr-umi/test-dumi-enum

What is Expected?

  • The menu path can contain enum words

  • In Chinese, only the Chinese menu is displayed

  • In English, only the English menu is displayed

What is actually happening?

living.gif

Contributor guide