mirror of
https://github.com/heyman/heynote.git
synced 2025-08-16 17:41:25 +02:00
Move contents of heynote-electron subdirectory into git repo root
This commit is contained in:
19
public/langdetect-worker.js
Normal file
19
public/langdetect-worker.js
Normal file
@ -0,0 +1,19 @@
|
||||
importScripts("highlight.min.js")
|
||||
|
||||
const HIGHLIGHTJS_LANGUAGES = ["json", "python", "javascript", "html", "sql", "java", "plaintext"]
|
||||
|
||||
onmessage = (event) => {
|
||||
//console.log("worker received message:", event.data)
|
||||
//importScripts("../../lib/highlight.min.js")
|
||||
|
||||
const result = self.hljs.highlightAuto(event.data.content, HIGHLIGHTJS_LANGUAGES);
|
||||
postMessage({
|
||||
highlightjs: {
|
||||
language: result.language,
|
||||
relevance: result.relevance,
|
||||
illegal: result.illegal,
|
||||
},
|
||||
content: event.data.content,
|
||||
idx: event.data.idx,
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user