Skip to content

Commit 7c2cc02

Browse files
Steve DaySteve Day
authored andcommitted
fixup! Move default highlight.js highlighting into a web worker
1 parent 65605cd commit 7c2cc02

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

public/js/highlight-worker.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// A very simple web worker for highlight.js
22
// See: https://highlightjs.org/usage/
3+
'use strict';
4+
5+
importScripts('/vendor/plugins/highlight/highlight.pack.js');
6+
37
onmessage = function(event) {
4-
importScripts('/vendor/plugins/highlight/highlight.pack.js');
58
var result = self.hljs.highlightAuto(event.data.text);
69
postMessage({index: event.data.index, html: result.value});
710
};

0 commit comments

Comments
 (0)