2020-04-13 18:32:31 +05:30
|
|
|
import {highlightBlock} from 'highlight.js';
|
|
|
|
import {createWindow} from 'domino';
|
|
|
|
|
2020-06-10 03:01:15 +05:30
|
|
|
self.addEventListener('message', ({data}) => {
|
2020-04-13 18:32:31 +05:30
|
|
|
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-10 03:01:15 +05:30
|
|
|
});
|