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

Snippet file "not found" error if the path has a space in it #1505

Closed
1 task done
nie7321 opened this issue Apr 1, 2019 · 1 comment
Closed
1 task done

Snippet file "not found" error if the path has a space in it #1505

nie7321 opened this issue Apr 1, 2019 · 1 comment
Labels
contribution welcome Contributions welcome type: bug Something isn't working

Comments

@nie7321
Copy link
Contributor

nie7321 commented Apr 1, 2019

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

Bug report

Including a snippet fails if there is a space anywhere in the path name. This snippet:

<<< @/docs/dev/tools/Test File.js

Results in an error showing the cut-off filename:

Not found: /Users/myuser/dev/my-cool-website/docs/dev/tools/Test

This happens if the space is in the @ alias (for cwd) -- I can rename the files under docs/, but when this builds in my CI env, there's a space that is outside of my control, which is really unfortunate!

Version

I am using 0.14.10.

Looking at the snippet code in the 1.x branch, I believe 1.x would be affected as well.

Steps to reproduce

  1. Create a page & include the snippet Test Doc.js
  2. Create a Test Doc.js file
  3. View the page & see the error.

What is expected?

The snippet should be included in the page.

What is actually happening?

The snippet is not being included in the page.

Other relevant information

  • Your OS: OS X 10.13.6
  • Node.js version: v11.12.0
  • Browser version: n/a
  • Is this a global or local install? Local
  • Which package manager did you use for the install? Yarn
  • Does this issue occur when all plugins are disabled? Yes
@nie7321
Copy link
Contributor Author

nie7321 commented Apr 1, 2019

Is there a reason this needs to split on space in addition to the opening curly brace for highlights?

https://github.com/vuejs/vuepress/blob/0.x/lib/markdown/snippet.js#L27

I don't see anything in the docs that says spaces are meaningful to the snippet syntax, but I am not an expert :-)

I can submit a PR w/ https://github.com/nie7321/vuepress/commits/snippets-split-on-space if you'd like!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome Contributions welcome type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants