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