Skip to content

Build your personal knowledge base with Trilium Notes

fix(standalone): convert HTML to Markdown in the worker

Elian Doran7effc025c6cb
diff --git a/apps/standalone/vite.config.mts b/apps/standalone/vite.config.mts
index 934bb12ad0..09d46619d1 100644
--- a/apps/standalone/vite.config.mts
+++ b/apps/standalone/vite.config.mts
@@ -372,6 +372,13 @@ export default defineConfig(() => ({
find: /^puppeteer$/,
replacement: join(__dirname, "src/stubs/empty.ts")
},
+ // Turnish's `browser` entry parses HTML with the page's `DOMParser` or `document`, but the
+ // Web Worker that runs core has neither. Its Node entry falls back to domino, a DOM written
+ // in plain JavaScript that loads no Node built-ins.
+ {
+ find: /^turnish$/,
+ replacement: join(__dirname, "../../node_modules/turnish/dist/index.node.mjs")
+ },
// EJS renders the share pages. Its ESM entry imports `node:fs` and `node:path` for the
// file-loading it only reaches through its own `include()` without an `includer`; the
// share renderer resolves includes itself or passes an `includer`, so the package's own