-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
- I confirm that this is an issue rather than a question.
Bug report
Steps to reproduce
- Save a new code snippet to
.vuepress/public/snippet.jswith any content. Here's an example:
const name = 'First Last'
// Create person object
let person = {
name: name,
email: '[email protected]'
}- Import code snippet in a Markdown file with lines highlighted:
<<< @/.vuepress/public/snippet.js{2-4,6} - Serve project locally with
npm run dev(or whatever your serve command is to runvuepress dev) - See error message: "Invalid code snippet option"
What is expected?
Code should be imported with highlighted lines.
What is actually happening?
Code import fails with message:
Invalid code snippet option
Examples:
<<< @/.vuepress/public/snippet.js- ✔️ Works (no highlighted lines)<<< @/.vuepress/public/snippet.js{2}- ✔️ Works (1 highlighted line)<<< @/.vuepress/public/snippet.js{2,4}- ✔️ Works (2 highlighted lines)<<< @/.vuepress/public/snippet.js{2-4}- ✔️ Works (1 range of highlighted lines)<<< @/.vuepress/public/snippet.js{2,4,6}- ❌ Fails (3 highlighted lines)<<< @/.vuepress/public/snippet.js{2-4,6}- ❌ Fails (1 range of highlighted lines and 1 single line)
Other relevant information
- Code highlighting works property in regular code blocks
- Output of
npx vuepress infoin my VuePress project:
Environment Info:
System:
OS: Windows 10 10.0.16299
CPU: (8) x64 Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz
Binaries:
Node: 10.15.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 41.16299.1480.0
npmPackages:
@vuepress/core: 1.5.2
@vuepress/theme-default: 1.5.2
vuepress: ^1.5.2 => 1.5.2
npmGlobalPackages:
vuepress: Not FoundMetadata
Metadata
Assignees
Labels
No labels