Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
highlight: function (code, lang) {
var res;
res = void 0;
if (!lang) {
return code;
}
switch (lang) {
case "js":
lang = "javascript";
}
try {
return res = hljs.highlight(lang, code).value;
} finally {
return res || code;
}
}
};
highlight: function (code, lang) {
var res = void 0;
if (!lang) {
return code;
}
switch (lang) {
case "js":
lang = "javascript";
}
try {
return res = hljs.highlight(lang, code).value;
} finally {
return res || code;
}
}
}, (opts.marked || {})));
highlight : function(code, lang) {
if (lang == 'js') lang = 'javascript';
if (lang && hljs.LANGUAGES[lang]) {
return hljs.highlight(lang, code).value;
}
return hljs.highlightAuto(code).value;
}
});
function highlightCode(code, lang) {
if (lang) {
return highlight.highlight(lang, code, true).value;
} else {
return highlight.highlightAuto(code).value;
}
}
highlight: function (code, lang) {
if (!lang) {
return highlight.highlightAuto(code).value;
}
if (lang === "html") lang = "erb";
if (highlight.listLanguages().indexOf(lang) >= 0) {
return highlight.highlight(lang, code).value;
} else {
return code;
}
}
});