mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-05 09:04:19 +01:00
CombodoBackofficeToolbox.InitCodeHighlighting: Add protection against not loaded lib
This commit is contained in:
@@ -134,6 +134,12 @@ const CombodoBackofficeToolbox = {
|
||||
* @constructor
|
||||
*/
|
||||
InitCodeHighlighting: function (oContainerElem = null, bForce = false) {
|
||||
// Check if the lib is loaded
|
||||
if (typeof hljs === 'undefined') {
|
||||
CombodoJSConsole.Error('Cannot format code snippets as the highlight.js lib is not loaded');
|
||||
return;
|
||||
}
|
||||
|
||||
if (oContainerElem === null) {
|
||||
oContainerElem = $('body');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user