1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-16 13:00:42 +01: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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;