diff --git a/examples/server/public/index.html.gz b/examples/server/public/index.html.gz index 09b079239..b01cd3108 100644 Binary files a/examples/server/public/index.html.gz and b/examples/server/public/index.html.gz differ diff --git a/examples/server/webui/package-lock.json b/examples/server/webui/package-lock.json index 37def1f9b..38b578aef 100644 --- a/examples/server/webui/package-lock.json +++ b/examples/server/webui/package-lock.json @@ -8,11 +8,11 @@ "name": "webui", "version": "0.0.0", "dependencies": { + "@vscode/markdown-it-katex": "^1.1.1", "autoprefixer": "^10.4.20", "daisyui": "^4.12.14", "highlight.js": "^11.10.0", "markdown-it": "^14.1.0", - "markdown-it-katex-gpt": "^1.1.0", "postcss": "^8.4.49", "tailwindcss": "^3.4.15", "textlinestream": "^1.1.1", @@ -616,6 +616,15 @@ "win32" ] }, + "node_modules/@vscode/markdown-it-katex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@vscode/markdown-it-katex/-/markdown-it-katex-1.1.1.tgz", + "integrity": "sha512-3KTlbsRBPJQLE2YmLL7K6nunTlU+W9T5+FjfNdWuIUKgxSS6HWLQHaO3L4MkJi7z7MpIPpY+g4N+cWNBPE/MSA==", + "license": "MIT", + "dependencies": { + "katex": "^0.16.4" + } + }, "node_modules/@vue/compiler-dom": { "version": "3.5.13", "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.13.tgz", @@ -1194,6 +1203,7 @@ "version": "8.3.0", "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "license": "MIT", "engines": { "node": ">= 12" } @@ -1568,6 +1578,7 @@ "https://opencollective.com/katex", "https://github.com/sponsors/katex" ], + "license": "MIT", "dependencies": { "commander": "^8.3.0" }, @@ -1610,14 +1621,6 @@ "markdown-it": "bin/markdown-it.mjs" } }, - "node_modules/markdown-it-katex-gpt": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/markdown-it-katex-gpt/-/markdown-it-katex-gpt-1.1.0.tgz", - "integrity": "sha512-jEuoIFXoVqIXFWUH6nT4LFGKRI24tNNZV07I9mozC5adDRKE6obTtSwtuSACfHwZtqLwpsBB6gHSHH8VyZjW9w==", - "dependencies": { - "katex": "^0.16.10" - } - }, "node_modules/mdurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", @@ -2164,7 +2167,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2181,7 +2183,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2198,7 +2199,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2215,7 +2215,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2232,7 +2231,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2249,7 +2247,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2266,7 +2263,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2283,7 +2279,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2300,7 +2295,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2317,7 +2311,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2334,7 +2327,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2351,7 +2343,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2368,7 +2359,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2385,7 +2375,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2402,7 +2391,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2419,7 +2407,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2436,7 +2423,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2453,7 +2439,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2470,7 +2455,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2487,7 +2471,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ diff --git a/examples/server/webui/package.json b/examples/server/webui/package.json index 74d0beeef..7d53a7a28 100644 --- a/examples/server/webui/package.json +++ b/examples/server/webui/package.json @@ -14,11 +14,11 @@ "vite": "^5.4.10" }, "dependencies": { + "@vscode/markdown-it-katex": "^1.1.1", "autoprefixer": "^10.4.20", "daisyui": "^4.12.14", "highlight.js": "^11.10.0", "markdown-it": "^14.1.0", - "markdown-it-katex-gpt": "^1.1.0", "postcss": "^8.4.49", "tailwindcss": "^3.4.15", "textlinestream": "^1.1.1", diff --git a/examples/server/webui/src/main.js b/examples/server/webui/src/main.js index badb1d219..0a7663408 100644 --- a/examples/server/webui/src/main.js +++ b/examples/server/webui/src/main.js @@ -5,7 +5,7 @@ import TextLineStream from 'textlinestream'; // math formula rendering import 'katex/dist/katex.min.css'; -import markdownItKatexGpt from 'markdown-it-katex-gpt'; +import markdownItKatex from '@vscode/markdown-it-katex'; // code highlighting import hljs from './highlight-config'; @@ -97,7 +97,14 @@ const VueMarkdown = defineComponent( return '
' + md.value.utils.escapeHtml(str) + '
';
}
}));
- md.value.use(markdownItKatexGpt);
+ md.value.use(markdownItKatex, {
+ delimiters: [
+ { left: '\\[', right: '\\]', display: true },
+ { left: '\\(', right: '\\)', display: false },
+ { left: '$$', right: '$$', display: false },
+ ],
+ throwOnError: false,
+ });
const origFenchRenderer = md.value.renderer.rules.fence;
md.value.renderer.rules.fence = (tokens, idx, ...args) => {
const content = tokens[idx].content;
diff --git a/examples/server/webui/vite.config.js b/examples/server/webui/vite.config.js
index 1a8f6b8bd..093f92267 100644
--- a/examples/server/webui/vite.config.js
+++ b/examples/server/webui/vite.config.js
@@ -4,7 +4,7 @@ import path from 'path';
import fs from 'fs';
import zlib from 'zlib';
-const MAX_BUNDLE_SIZE = 1024 * 1024; // only increase when absolutely necessary
+const MAX_BUNDLE_SIZE = 1.5 * 1024 * 1024; // only increase when absolutely necessary
const GUIDE_FOR_FRONTEND = `