1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-24 10:12:54 +02:00

Check if hljs has language (#699)

This commit is contained in:
Barry vd. Heuvel
2024-12-15 20:19:03 +01:00
committed by GitHub
parent f622fa5ed5
commit f3b0022b54

View File

@@ -53,7 +53,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
if (typeof(hljs) === 'undefined') {
return htmlize(code);
}
if (lang) {
if (lang && hljs.getLanguage(lang)) {
return hljs.highlight(code, {language: lang}).value;
}
return hljs.highlightAuto(code).value;