Closed knownasilya closed 4 years ago
Looks like highlightedCodeBlock = Prism.highlight(codeblock, Prism.languages[language], language) + end;
specifically Prism.languages[language]
returns undefined when language
is 'hbs'
. But the index.js seems to specify the defaults and handlebars is included.
BTW Prism.languages
doesn't have 'handlebars'
either.
So I just pasted the defaults from index.js to my ember-cli-build.js and used 'handlebars' and it works. Not sure why the defaults don't come over.
Prism does not seem to add/support shorthand aliases by default. handlebars
and javascript
should work (if their respective components are configured to be enabled) while hbs
and js
do not.
I've created a PR #5 which makes it clearer that something is not supported instead of having it throw this vague error. It also falls back to non-highlighted code if a language is not found.
I might try integrating it with tests so people can also easily see this when they author a blog just on github for example.
The above PR has been merged and released as 2.1.0
Hey @knownasilya did you get a chance to test this with the latest version? We're pretty sure that we have fixed it and we have confirmed that it's working on the working branch of the new Ember blog https://deploy-preview-7--ember-blog-legacy.netlify.app/the-emberjs-times-issue-49/
I'm going to close this for now but if you still have the problem please let me know and we can open it again 👍