mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-27 18:01:21 +03:00
13 lines
360 B
JavaScript
13 lines
360 B
JavaScript
|
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});
|
||
|
};
|