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

When I import code Snippets,It doesn't work as expected and show "Not Found: E" #1151

Closed
1 task done
jiaming743 opened this issue Jan 2, 2019 · 3 comments
Closed
1 task done

Comments

@jiaming743
Copy link

jiaming743 commented Jan 2, 2019

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

Bug report

When I import code Snippets,It doesn't work as expected and show "Not Found: E"

I tried to clone your project and run it, it still doesn't show up as expected.

git clone https://github.com/vuejs/vuepress.git
cd vuepress
yarn
yarn dev

http://localhost:8080/guide/markdown.html#import-code-snippets

Import Code Snippets

Input

<<< @/test/markdown/fragments/snippet.js{2}

Output

Not Found: E

Version

global ([email protected]) and local ([email protected])

Steps to reproduce

What is expected?

show code snippets

What is actually happening?

Not Found: E

Other relevant information

  • Your OS: Windows 10
  • Node.js version: 10.13.0
  • Browser version: Chrome 70.0.3538.102
  • Is this a global or local install? global ([email protected]) and local ([email protected])
  • Which package manager did you use for the install? yarn
@shigma
Copy link
Collaborator

shigma commented Jan 28, 2019

https://github.com/vuejs/vuepress/blob/master/packages/@vuepress/markdown/lib/snippet.js#L27

It seems that vuepress delete all characters after :, which results in this problem.

@jiaming743
Copy link
Author

It seems that vuepress delete all characters after :, which results in this problem.

Thanks

@jiaming743
Copy link
Author

https://github.com/vuejs/vuepress/blob/master/packages/@vuepress/markdown/lib/snippet.js#L27

It seems that vuepress delete all characters after :, which results in this problem.

I removed ":" but it still shows Not found: E

myProject/node_modules/vuepress/lib/markdown/snippet.js#27
const filename = rawPath.split(/[{\s]/).shift()

What's more

I tried console.log(content) and the contents of the file can be read normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants