We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d142729 commit 57403a8Copy full SHA for 57403a8
src/DebugBar/Resources/widgets.js
@@ -47,14 +47,20 @@ if (typeof(PhpDebugBar) == 'undefined') {
47
* @return {String}
48
*/
49
var highlight = PhpDebugBar.Widgets.highlight = function(code, lang) {
50
- if (typeof(code) == 'string') {
+ if (typeof(code) === 'string') {
51
+ if (!hljs) {
52
+ return htmlize(code);
53
+ }
54
if (lang) {
55
return hljs.highlight(lang, code).value;
56
}
57
return hljs.highlightAuto(code).value;
58
59
- code.each(function(i, e) { hljs.highlightBlock(e); });
60
+ if (hljs) {
61
+ code.each(function(i, e) { hljs.highlightBlock(e); });
62
63
+ return code;
64
};
65
66
/**
0 commit comments