-
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
Uncaught Error: Unknown language: "undefined" #803
Comments
how to track the issue progress? |
@Obooman: Thank you for asking. Believe this has actually be resolved as of the latest...but we've done a lot over the last 60 days. Can you attach a screenshot or code block demonstrating that you're still receiving the error? If so, will reopen. |
Thanks, @joshbruce, it's my mistake.I use highlight.js language-determined way to render all code blocks. Here is a note; markedRenderer.code = function (code, language) {
return '<pre><code class="hljs ' +
(
language ?
language :
''
) +
'">' +
(
language ?
hljs.highlight(language, code).value :
hljs.highlightAuto(code).value
) +
"</code></pre>";
}; BTW, has |
Hmmm...thanks for the follow up. The example definitely feels like a hacking way of doing it. In theory, according to the GFM spec, you should be able to put the language short name after the fence: https://github.github.com/gfm/#example-111 Renderer.prototype.code = function(code, lang, escaped) {
if (this.options.highlight) {
var out = this.options.highlight(code, lang);
if (out != null && out !== code) {
escaped = true;
code = out;
}
}
if (!lang) {
return '<pre><code>'
+ (escaped ? code : escape(code, true))
+ '\n</code></pre>';
}
return '<pre><code class="'
+ this.options.langPrefix
+ escape(lang, true)
+ '">'
+ (escaped ? code : escape(code, true))
+ '\n</code></pre>\n';
}; Believe this is the Marked code that handles it. So, it looks like you should be able to set some options and have this done for you instead of overriding. What is happening when you use just Marked? What was tried?What was expected/desired?What was output? |
Tagging in @Feder1co5oave for situational awareness. |
When i used (```) and don't flow with any program language, it will parse fail and with exception. In my mind, whatever it should not be crash for any type of text. If it is not a markdown syntax,just show it origin.
The text was updated successfully, but these errors were encountered: