koishi-plugin-latex-render 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -156,7 +156,9 @@ function generateHtml(content, config) {
156
156
  const katexOptions = {
157
157
  throwOnError: false,
158
158
  // 保持不报错降级
159
- strict: false
159
+ strict: false,
160
+ output: "html"
161
+ // 强制只输出 HTML 排版,绝不生成辅助阅读的 MathML
160
162
  };
161
163
  if (hasMarkdown) {
162
164
  const latexCache = [];
@@ -219,8 +221,13 @@ ${placeholder}
219
221
  <html>
220
222
  <head>
221
223
  <meta charset="UTF-8">
222
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css">
224
+ <link rel="stylesheet" href="https://cdn.staticfile.net/KaTeX/0.16.9/katex.min.css">
223
225
  <style>
226
+ /* 🌟 彻底干掉辅助阅读的 MathML,防止重影 */
227
+ .katex-mathml {
228
+ display: none !important;
229
+ }
230
+
224
231
  * { margin: 0; padding: 0; box-sizing: border-box; }
225
232
  body {
226
233
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
package/lib/index.js CHANGED
@@ -156,7 +156,9 @@ function generateHtml(content, config) {
156
156
  const katexOptions = {
157
157
  throwOnError: false,
158
158
  // 保持不报错降级
159
- strict: false
159
+ strict: false,
160
+ output: "html"
161
+ // 强制只输出 HTML 排版,绝不生成辅助阅读的 MathML
160
162
  };
161
163
  if (hasMarkdown) {
162
164
  const latexCache = [];
@@ -219,8 +221,13 @@ ${placeholder}
219
221
  <html>
220
222
  <head>
221
223
  <meta charset="UTF-8">
222
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css">
224
+ <link rel="stylesheet" href="https://cdn.staticfile.net/KaTeX/0.16.9/katex.min.css">
223
225
  <style>
226
+ /* 🌟 彻底干掉辅助阅读的 MathML,防止重影 */
227
+ .katex-mathml {
228
+ display: none !important;
229
+ }
230
+
224
231
  * { margin: 0; padding: 0; box-sizing: border-box; }
225
232
  body {
226
233
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-latex-render",
3
3
  "description": "ChatLuna 专用 - 将 AI 返回的 LaTeX 公式渲染为图片",
4
- "version": "1.1.3",
4
+ "version": "1.1.5",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [