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

Confusing error on unrecognized language #18

Closed
porglezomp opened this issue Nov 2, 2019 · 1 comment
Closed

Confusing error on unrecognized language #18

porglezomp opened this issue Nov 2, 2019 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@porglezomp
Copy link

If I use an unrecognized syntax, for instance:

File index.md:

```asdfl
```

Then the error is confusing.

Language does not exist asdfl
Problem writing Eleventy templates: (more in DEBUG output)
> Having trouble rendering njk (and markdown) template ./index.md

`TemplateContentRenderError` was thrown
> Cannot read property 'rest' of undefined

The first line mentions that the language doesn't exist, but I didn't realize for quite a while that that warning was the cause of the later fatal error.

Expected Behavior:
Unrecognized languages should give a warning and then simply fail to highlight that syntax.

@porglezomp porglezomp changed the title Confusing error on unrecognized syntax Confusing error on unrecognized language Nov 2, 2019
@zachleat
Copy link
Member

zachleat commented Jan 3, 2020

That console.warn Language does not exist asdfl actually comes from Prism, unfortunately. PrismJS/prism#2145

But we can clean up the error message.

@zachleat zachleat added this to the v3.0.1 milestone Jan 3, 2020
@zachleat zachleat added the enhancement New feature or request label Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants