2020-04-13 13:02:31 +00:00
|
|
|
import {highlightBlock} from 'highlight.js';
|
|
|
|
import {createWindow} from 'domino';
|
|
|
|
|
2020-06-09 21:31:15 +00:00
|
|
|
self.addEventListener('message', ({data}) => {
|
2020-04-13 13:02:31 +00:00
|
|
|
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});
|
2020-06-09 21:31:15 +00:00
|
|
|
});
|