Skip to content

Commit ed30ed7

Browse files
committed
Check if hljs is defined
Really fixes php-debugbar#107 and php-debugbar#108
1 parent 57403a8 commit ed30ed7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DebugBar/Resources/widgets.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
4848
*/
4949
var highlight = PhpDebugBar.Widgets.highlight = function(code, lang) {
5050
if (typeof(code) === 'string') {
51-
if (!hljs) {
51+
if (typeof(hljs) === 'undefined') {
5252
return htmlize(code);
5353
}
5454
if (lang) {
@@ -57,7 +57,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
5757
return hljs.highlightAuto(code).value;
5858
}
5959

60-
if (hljs) {
60+
if (typeof(hljs) === 'object') {
6161
code.each(function(i, e) { hljs.highlightBlock(e); });
6262
}
6363
return code;

0 commit comments

Comments
 (0)