kamrify commited on
Commit
6d6655e
·
1 Parent(s): 92868a7

Fix - Demo doesn't work when code highlight fails

Browse files
Files changed (1) hide show
  1. demo/scripts/demo.js +8 -4
demo/scripts/demo.js CHANGED
@@ -128,10 +128,14 @@ document.addEventListener('DOMContentLoaded', function () {
128
  });
129
 
130
 
131
- document.querySelectorAll('pre code')
132
- .forEach((element) => {
133
- hljs.highlightBlock(element);
134
- });
 
 
 
 
135
 
136
 
137
  /////////////////////////////////////////////
 
128
  });
129
 
130
 
131
+ try {
132
+ document.querySelectorAll('pre code')
133
+ .forEach((element) => {
134
+ hljs.highlightBlock(element);
135
+ });
136
+ } catch (e) {
137
+ // Silently ignore the highlight errors
138
+ }
139
 
140
 
141
  /////////////////////////////////////////////