Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In a link, substring "index" and beyond is dropped from filename #996

Closed
1 task done
Leedehai opened this issue Nov 11, 2018 · 1 comment
Closed
1 task done

In a link, substring "index" and beyond is dropped from filename #996

Leedehai opened this issue Nov 11, 2018 · 1 comment
Labels
type: enhancement Request to enhance an existing feature

Comments

@Leedehai
Copy link

Leedehai commented Nov 11, 2018

  • I confirm that this is a issue rather than a question.

Bug report

In a Markdown file's internal link, if the link's filename ends with "index.md", e.g. "creating-index.md", in the generated HTML, that link links to a file named "creating-".

Version

0.14.4

Steps to reproduce

Embed an internal link inside a Markdown file under directory docs/guide/. The link is [instruction-index.md](creating-index.md), like so:
screen shot 2018-11-10 at 16 09 34

Build the website locally using npm run docs:build. Then in the generated website, hover above that link, you'll see the URL of this link is actually to a page named "creating-", like so
screen shot 2018-11-10 at 16 10 52

What is expected?

The link should point to xxx/guide/creating-index.html

What is actually happening?

The link points to xxx/guide/creating-

Other relevant information

I tried other filenames.

If the file is named creatingindex.md (without the hyphen in between), then the link is xxx/guide/creating.

If the file is named instruction-index.md, then the link is xxx/guide/instruction-.

if the file is named 01234567index.md, then the link is xxx/guide/01234567.

if the file is named 01234567-readme.md, then the link is xxx/guide/01234567- (the "readme" substring is cut, too)

suspect
I have a suspect, though: vuepress/packages/@vuepress/markdown/lib/link.js, variable indexRE.


  • Your OS: macOS 10.14
  • Node.js version: 11.0.0
  • Browser version: Chrome 70.0.3538.77
  • Is this a global or local install? Global
  • Which package manager did you use for the install? npm
@Leedehai Leedehai changed the title substring "index" is dropped from filename In a link, substring "index" and beyond is dropped from filename Nov 11, 2018
@ulivz ulivz added the type: enhancement Request to enhance an existing feature label Nov 13, 2018
@ulivz
Copy link
Member

ulivz commented Nov 25, 2018

Fixed at 1340e37 and release at 0.14.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Request to enhance an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants