mirror of
https://github.com/jupyter/notebook.git
synced 2025-03-19 13:20:36 +08:00
Merge pull request #3269 from minrk/babel
protect highlight.js against unknown languages
This commit is contained in:
commit
331326a27b
@ -101,9 +101,9 @@ $(document).ready(function () {
|
||||
langPrefix: "language-",
|
||||
highlight: function(code, lang) {
|
||||
var highlighted;
|
||||
if (lang) {
|
||||
try {
|
||||
highlighted = hljs.highlight(lang, code, false);
|
||||
} else {
|
||||
} catch(err) {
|
||||
highlighted = hljs.highlightAuto(code);
|
||||
}
|
||||
return highlighted.value;
|
||||
|
Loading…
x
Reference in New Issue
Block a user