How to use the configure function from highlight.js

Find comprehensive JavaScript highlight.js.configure code examples handpicked from public code repositorys.

95
96
97
98
99
100
101
102
103
104
with some fixed number of spaces or with a `<span>` to give them special
styling:

```html
<script type="text/javascript">
  hljs.configure({tabReplace: '    '}); // 4 spaces
  // ... or
  hljs.configure({tabReplace: '<span class="indent">\t</span>'});

  hljs.initHighlightingOnLoad();
fork icon8
star icon30
watch icon5

+ 3 other calls in file

4
5
6
7
8
9
10
11
12
13
14
15


// This function will run for every page once loaded (script is deffered)
const common = () => {
  // Highlight.js
  // Highlight source code snippets
  hljs.configure({ languages: [] }); // Do not try to guess the language
  hljs.initHighlightingOnLoad(); // Highlight code


  // Lozad
  // Lazy load images (when they enter the viewport)
fork icon2
star icon4
watch icon0