You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
360 B
13 lines
360 B
5 years ago
|
import {highlightBlock} from 'highlight.js';
|
||
|
import {createWindow} from 'domino';
|
||
|
|
||
|
self.onmessage = function ({data}) {
|
||
|
const window = createWindow();
|
||
|
self.document = window.document;
|
||
|
|
||
|
const {index, html} = data;
|
||
|
document.body.innerHTML = html;
|
||
|
highlightBlock(document.body.firstChild);
|
||
|
self.postMessage({index, html: document.body.innerHTML});
|
||
|
};
|