-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Don't throw an exception for unknown code block languages #810
Comments
I'm pretty sure this is highlight.js throwing the exception, and marked just reports it. What options are you using? |
To prevent this exception, I did: markedProvider.setOptions({
gfm: true,
tables: true,
breaks: false,
pedantic: false,
sanitize: true, // if false -> allow plain old HTML ;)
smartLists: true,
smartypants: false,
highlight: function (code, lang) {
if (lang && hljs.getLanguage(lang)) {
return hljs.highlight(lang, code, true).value;
} else {
return hljs.highlightAuto(code).value;
}
}
}); Hope it helps. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In my source content, I have:
This results in a Javascript error:
If an unknown language is encountered, it should be treated as plain text rather than throwing an exception.
The text was updated successfully, but these errors were encountered: