Format
This commit is contained in:
parent
134c767484
commit
908a7bda9a
|
|
@ -12,7 +12,7 @@ function wait_highlight(...args) {
|
|||
try {
|
||||
const subChannel = new MessageChannel();
|
||||
worker.postMessage({ signal, port: subChannel.port1, args }, [
|
||||
subChannel.port1
|
||||
subChannel.port1,
|
||||
]);
|
||||
Atomics.wait(signal, 0, 0);
|
||||
return receiveMessageOnPort(subChannel.port2).message.result;
|
||||
|
|
|
|||
|
|
@ -3,19 +3,17 @@ const shiki = require("shiki");
|
|||
const path = require("path");
|
||||
|
||||
async function shiki_highlight(code, lang) {
|
||||
const highlighter = await
|
||||
shiki
|
||||
.getHighlighter({
|
||||
theme: 'nord',
|
||||
const highlighter = await shiki.getHighlighter({
|
||||
theme: "nord",
|
||||
langs: [
|
||||
{
|
||||
id: "kdl",
|
||||
scopeName: "source.kdl",
|
||||
path: path.join(process.cwd(), "kdl.tmLanguage.json")
|
||||
}
|
||||
]
|
||||
})
|
||||
return highlighter.codeToHtml(code, lang)
|
||||
path: path.join(process.cwd(), "kdl.tmLanguage.json"),
|
||||
},
|
||||
],
|
||||
});
|
||||
return highlighter.codeToHtml(code, lang);
|
||||
}
|
||||
|
||||
parentPort.addListener("message", async ({ signal, port, args }) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue