-
Notifications
You must be signed in to change notification settings - Fork 614
fix(math): parser by upgrade vue-renderer-markdown #722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughUpdated vue-renderer-markdown from ^0.0.32 to ^0.0.34 in package.json (dependencies and devDependencies). Removed two vue-renderer-markdown dist paths from Tailwind’s content array in tailwind.config.js. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
package.json(1 hunks)tailwind.config.js(0 hunks)
💤 Files with no reviewable changes (1)
- tailwind.config.js
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Use Shadcn Vue, Radix Vue, and Tailwind for components and styling.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T01:45:33.790Z
Learning: Applies to src/renderer/src/**/*.vue : Use Tailwind CSS with scoped styles for styling
📚 Learning: 2025-07-23T00:45:57.322Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Use Shadcn Vue, Radix Vue, and Tailwind for components and styling.
Applied to files:
package.json
📚 Learning: 2025-07-21T01:46:30.354Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/**/* : Use the 'vue-i18n' framework for all internationalization in the renderer
Applied to files:
package.json
📚 Learning: 2025-07-23T00:45:57.322Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Use Vue 3 with TypeScript, leveraging defineComponent and PropType.
Applied to files:
package.json
📚 Learning: 2025-07-21T01:47:11.608Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-21T01:47:11.608Z
Learning: Applies to src/renderer/**/*.{vue,ts,js,tsx,jsx} : 渲染进程代码放在 `src/renderer`
Applied to files:
package.json
📚 Learning: 2025-07-23T00:45:57.322Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/{composables,utils}/**/*.ts : Use VueUse for common composables and utility functions.
Applied to files:
package.json
🔇 Additional comments (2)
package.json (2)
158-158: Version bump looks goodUpgrading vue-renderer-markdown to ^0.0.34 aligns with the stated goal and keeps the range to patch updates in 0.0.x.
158-158: AI summary discrepancy: only one occurrence updated hereSummary mentions two occurrences (dependencies and devDependencies). In this file, only devDependencies shows vue-renderer-markdown. Please confirm if another occurrence exists elsewhere or if the summary is outdated.
| "vue": "^3.5.14", | ||
| "vue-i18n": "^11.1.3", | ||
| "vue-renderer-markdown": "^0.0.32", | ||
| "vue-renderer-markdown": "^0.0.34", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Confirm math/KaTeX peer dependency and CSS inclusion
New math parsing may require KaTeX/MathJax and CSS (e.g., katex/dist/katex.min.css). I don’t see katex listed; please verify library requirements and ensure CSS is bundled.
🌐 Web query:
What are the peer/runtime dependencies and setup steps (including CSS) for vue-renderer-markdown@^0.0.34 to enable math (KaTeX/MathJax) rendering in Vue 3?
💡 Result:
The package vue-renderer-markdown@^0.0.34 is a Vue 3 component that renders Markdown and includes optional math support (KaTeX/MathJax) via markdown-it plugins; to enable math, you must install a math renderer and include its CSS (for KaTeX) or script/config (for MathJax), then pass the plugin into the component’s markdown-it setup.[6]
What to install
- Required runtime peer: markdown-it is bundled by the component, but math needs one of:
- KaTeX: install katex and the markdown-it-katex plugin.[3]
- MathJax (v3 recommended): install mathjax-full (or load MathJax from CDN) and a markdown-it MathJax integration; then load/configure MathJax on the page.[2][4]
KaTeX setup (recommended for speed)
- Install packages:
- npm i vue-renderer-markdown katex markdown-it-katex[3][6]
- Import KaTeX CSS (required for proper math rendering):
- In your main entry or a global style: import 'katex/dist/katex.min.css'[3]
- If you want GitHub-like markdown styling, also include a markdown CSS, e.g., github-markdown-css (optional).[3]
- Register markdown-it-katex with vue-renderer-markdown:
- Use the component’s plugin hook to pass markdown-it-katex into the parser.
Example:
// main.ts or a setup file
import 'katex/dist/katex.min.css' // KaTeX styles are required[3]<script setup lang="ts">
import MarkdownRender from 'vue-renderer-markdown'
import markdownItKatex from 'markdown-it-katex'
const content = `
Inline math: $e^{i\\pi}+1=0$.
Block:
$$
\\int_{-\\infty}^{\\infty} e^{-x^2} dx = \\sqrt{\\pi}
$$
`
// vue-renderer-markdown exposes a markdown-it instance internally and supports plugins;
// pass markdown-it-katex so it renders $...$ and $$...$$ as math.
const plugins = [markdownItKatex]
</script>
<template>
<MarkdownRender :content="content" :plugins="plugins" />
</template>Notes:
- markdown-it-katex accepts options like { throwOnError: false, errorColor: '#cc0000' } if you need tolerant rendering.[3]
MathJax setup (alternative)
- Install or load MathJax:
- npm i mathjax-full, or load MathJax v3 from a CDN and configure it on the page.[2][4]
- Provide a markdown-it integration that converts TeX delimiters (
$…$ ,$$…$$ ) into MathJax-processed nodes, and ensure MathJax is initialized to scan the rendered HTML:
- Load and configure MathJax before/after markdown render, e.g., window.MathJax = { tex: { inlineMath: [['$', '$']], displayMath: [['$$','$$']] } } and then queue typesetting after content updates.[4]
- VuePress’s markdown-math plugin demonstrates the pattern: install either mathjax-full or katex and configure delimiters.[2]
- CSS:
- MathJax renders with its own CSS injected by the script; no extra CSS import is typically needed. KaTeX CSS is not used with MathJax.[4]
Supported math syntax
- Inline: $ ... $
- Display: $$ ... $$ (space-variant $$ ... $$ also supported by common configs)[2][3]
Where these requirements come from
- vue-renderer-markdown advertises math support but relies on markdown-it plugins and a math engine; you supply katex + markdown-it-katex (plus KaTeX CSS) or MathJax + configuration.[6][3][4]
- Ecosystem guidance (VuePress markdown-math) shows the requirement to install katex or mathjax-full and configure delimiters.[2]
Citations:
- 1: https://www.npmjs.com/package/vue-markdown-render
- 2: https://ecosystem.vuejs.press/plugins/markdown/markdown-math.html
- 3: https://github.com/waylonflinn/markdown-it-katex
- 4: https://docs.mathjax.org/en/stable/configuration.html
- 5: https://libraries.io/npm/vue-renderer-markdown-monaco
- 6: https://github.com/Simon-He95/vue-markdown-render
- 7: https://vuepress-community.netlify.app/en/plugins/mathjax/
- 8: mathjax / katex / latex rendering for the markdown gridsome/gridsome-starter-blog#22
- 9: https://javascript.plainenglish.io/vue-js-markdown-renderer-component-with-code-highlight-support-5cde100f6e0d
- 10: https://blog.openreplay.com/how-to-parse-and-render-markdown-in-vuejs/
Add KaTeX dependencies and CSS for math support
To enable math rendering with vue-renderer-markdown@^0.0.34, you must install a math engine and include its styles. Update your setup as follows:
• package.json (add these alongside vue-renderer-markdown):
"dependencies": {
"vue-renderer-markdown": "^0.0.34",
+ "katex": "^0.16.8",
+ "markdown-it-katex": "^4.1.0"
}• In your main entry (e.g. main.ts or main.js), import KaTeX’s CSS:
import 'katex/dist/katex.min.css';• When you use the component, register the plugin:
<script setup lang="ts">
import MarkdownRender from 'vue-renderer-markdown'
import markdownItKatex from 'markdown-it-katex'
const plugins = [markdownItKatex]
</script>
<template>
<MarkdownRender :content="content" :plugins="plugins" />
</template>This ensures KaTeX is available at runtime and its CSS is bundled.
If you prefer MathJax instead, install mathjax-full, configure delimiters, and let MathJax inject its own styles—no extra CSS import is needed.
🤖 Prompt for AI Agents
In package.json around line 158, add KaTeX runtime dependencies next to
"vue-renderer-markdown" (install katex and markdown-it-katex or, if preferring
MathJax, install mathjax-full) so the math engine is available at runtime; then
in your main entry (main.ts / main.js) import the KaTeX CSS with import
'katex/dist/katex.min.css'; and when using the Markdown renderer, register the
markdown-it-katex plugin (or configure MathJax if chosen) and pass it in via the
component plugins prop so math is rendered and styles are bundled.
💡 Verification agent
🧩 Analysis chain
Verify dependency classification (dev vs prod) for packaging
If vue-renderer-markdown is imported by renderer code at runtime, it should live in dependencies so electron-builder includes it in production. Please confirm usage and move if needed.
Run to locate imports and usage:
If used at runtime, consider this change:
--- a/package.json
+++ b/package.json
@@
"dependencies": {
@@
- "zod": "^3.24.3"
+ "zod": "^3.24.3",
+ "vue-renderer-markdown": "^0.0.34"
},
@@
- "vue-renderer-markdown": "^0.0.34",🏁 Script executed:
#!/bin/bash
# Find imports of vue-renderer-markdown across the repo
rg -n --no-heading $'from\\s+[\'"]vue-renderer-markdown[\'"]|require\\([\'"]vue-renderer-markdown[\'"]\\)' -A 2 -B 2
# Also check dynamic imports/usages
rg -n 'vue-renderer-markdown' -A 2 -B 2Length of output: 6251
🏁 Script executed:
#!/bin/bash
# Show 'dependencies' section around vue-renderer-markdown
rg -n '"dependencies"' -A20 -B5 package.json
# Show 'devDependencies' section for context
rg -n '"devDependencies"' -A20 -B5 package.jsonLength of output: 2211
Move vue-renderer-markdown into dependencies
vue-renderer-markdown is imported at runtime by the renderer (e.g. in src/renderer/src/main.ts, MarkdownRenderer.vue, MessageBlockThink.vue, etc.), so it must live under "dependencies" for electron-builder to include it in the production bundle.
• Affected file:
- package.json
Suggested diff:
--- a/package.json
+++ b/package.json
@@ "dependencies": {
"file-type": "^20.5.0",
+ "vue-renderer-markdown": "^0.0.34",
@@ "devDependencies": {
- "vue-renderer-markdown": "^0.0.34",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "vue-renderer-markdown": "^0.0.34", | |
| // In package.json, move vue-renderer-markdown from devDependencies into dependencies | |
| { | |
| "dependencies": { | |
| "file-type": "^20.5.0", | |
| "vue-renderer-markdown": "^0.0.34", | |
| // …other dependencies | |
| }, | |
| "devDependencies": { | |
| // …other devDependencies (vue-renderer-markdown has been removed) | |
| } | |
| } |
🤖 Prompt for AI Agents
In package.json around line 158, the dependency "vue-renderer-markdown" is
listed under devDependencies but is required at runtime by the renderer; move
the "vue-renderer-markdown": "^0.0.34" entry from devDependencies into
dependencies (remove it from devDependencies and add the same entry under
dependencies) so electron-builder includes it in the production bundle and
renderer imports resolve at runtime.
* chore: bump deps * fix: rolldown-vite 7.1.0 and duckdb bundle issue * chore: back to vite * chore: update electron * chore: update versions * fix(math): parser by upgrade vue-renderer-markdown (#722) * chore: bump deps --------- Co-authored-by: Simon He <57086651+Simon-He95@users.noreply.github.com>
* fix: add AlertDialogDescription to resolve accessibility warning (#706) * fix: resolve focus flicker when creating new windows with Ctrl+Shift+N (#707) * feat: enhance window management by implementing main window ID handling (#709) * docs: update zhipu developer doc website link (#715) Co-authored-by: gongchao <chao.gong@aminer.cn> * refactor: better translate (#716) * chore: en-us i18n * chore(i18n): polish ja-JP translations across UI; keep chat.input.placeholder unchanged * chore(i18n): polish fr-FR translations; keep chat.input.placeholder unchanged * chore(i18n): refine fr-FR MCP & Settings copy; idiomatic, concise, brand-consistent * chore(i18n): polish ru-RU translations across UI; keep chat.input.placeholder unchanged * chore(i18n): polish fa-IR translations across UI; keep chat.input.placeholder unchanged * chore: fix format * chore: fix i18n * chore: lock rolldown-vite version * feat: add GPT-5 series model support (#717) * ci(vite): Bundle the main file into a single file to speed up loading. (#718) * fix(math): parser by upgrade vue-renderer-markdown (#722) * chore: bump deps (#721) * chore: bump deps * fix: rolldown-vite 7.1.0 and duckdb bundle issue * chore: back to vite * chore: update electron * chore: update versions * fix(math): parser by upgrade vue-renderer-markdown (#722) * chore: bump deps --------- Co-authored-by: Simon He <57086651+Simon-He95@users.noreply.github.com> * fix: add scrollable support to PopoverContent to prevent overflow (#720) * feat: implement floating chat window system with performance optimization (#724) * feat: add mcp sync and modelscope provider #615 (#723) * wip: add modelscope provider * feat: add mcp sync to modelscope * fix: add scrollable support to PopoverContent to prevent overflow (#720) * feat: implement floating chat window system with performance optimization (#724) * chore: i18n and format * feat: better style * fix: mcp tool display --------- Co-authored-by: yyhhyyyyyy <yyhhyyyyyy8@gmail.com> * fix: move_files newPath parse issue (#725) * fix: move_files newPath 参数计算规则 * fix: move_files 移动前需要判断dest是目录还是文件 * feat: add Claude Opus 4.1 to anthropic default model list (#726) * feat: Add mcprouter's MCP marketplace api support (#727) * wip: add mcp market * feat: mcp market install * wip: mcp install status sync * feat: mcp server config mask * chore: remove working doc * chore: add translate * feat: add ESC key to close floating chat window (#728) * feat: add floating button position persistence with boundary validation (#729) * feat: add floating button position persistence with boundary validation * feat: refactor floating button to use electron-window-state * chore: bump to 0.3.0 * feat: add reasoning_effort parameter support for gpt-oss models (#731) * feat: add reasoning_effort parameter support for gpt-oss models - add reasoning effort UI support across all components * fix: preserve user reasoning effort settings and improve display logic * fix: artifacts code not streaming (#732) * fix: artifact react load failed * chore: remove log * fix: artifacts code not stream * fix: format --------- Co-authored-by: yyhhyyyyyy <yyhhyyyyyy8@gmail.com> Co-authored-by: hllshiro <40970081+hllshiro@users.noreply.github.com> Co-authored-by: tomsun28 <tomsun28@outlook.com> Co-authored-by: gongchao <chao.gong@aminer.cn> Co-authored-by: Simon He <57086651+Simon-He95@users.noreply.github.com> Co-authored-by: wanna <wanna.w@binarywalk.com>
* fix: add AlertDialogDescription to resolve accessibility warning (#706) * fix: resolve focus flicker when creating new windows with Ctrl+Shift+N (#707) * feat: enhance window management by implementing main window ID handling (#709) * docs: update zhipu developer doc website link (#715) Co-authored-by: gongchao <chao.gong@aminer.cn> * refactor: better translate (#716) * chore: en-us i18n * chore(i18n): polish ja-JP translations across UI; keep chat.input.placeholder unchanged * chore(i18n): polish fr-FR translations; keep chat.input.placeholder unchanged * chore(i18n): refine fr-FR MCP & Settings copy; idiomatic, concise, brand-consistent * chore(i18n): polish ru-RU translations across UI; keep chat.input.placeholder unchanged * chore(i18n): polish fa-IR translations across UI; keep chat.input.placeholder unchanged * chore: fix format * chore: fix i18n * chore: lock rolldown-vite version * feat: add GPT-5 series model support (#717) * ci(vite): Bundle the main file into a single file to speed up loading. (#718) * fix(math): parser by upgrade vue-renderer-markdown (#722) * chore: bump deps (#721) * chore: bump deps * fix: rolldown-vite 7.1.0 and duckdb bundle issue * chore: back to vite * chore: update electron * chore: update versions * fix(math): parser by upgrade vue-renderer-markdown (#722) * chore: bump deps --------- Co-authored-by: Simon He <57086651+Simon-He95@users.noreply.github.com> * fix: add scrollable support to PopoverContent to prevent overflow (#720) * feat: implement floating chat window system with performance optimization (#724) * feat: add mcp sync and modelscope provider #615 (#723) * wip: add modelscope provider * feat: add mcp sync to modelscope * fix: add scrollable support to PopoverContent to prevent overflow (#720) * feat: implement floating chat window system with performance optimization (#724) * chore: i18n and format * feat: better style * fix: mcp tool display --------- Co-authored-by: yyhhyyyyyy <yyhhyyyyyy8@gmail.com> * fix: move_files newPath parse issue (#725) * fix: move_files newPath 参数计算规则 * fix: move_files 移动前需要判断dest是目录还是文件 * feat: add Claude Opus 4.1 to anthropic default model list (#726) * feat: Add mcprouter's MCP marketplace api support (#727) * wip: add mcp market * feat: mcp market install * wip: mcp install status sync * feat: mcp server config mask * chore: remove working doc * chore: add translate * feat: add ESC key to close floating chat window (#728) * feat: add floating button position persistence with boundary validation (#729) * feat: add floating button position persistence with boundary validation * feat: refactor floating button to use electron-window-state * chore: bump to 0.3.0 * feat: add reasoning_effort parameter support for gpt-oss models (#731) * feat: add reasoning_effort parameter support for gpt-oss models - add reasoning effort UI support across all components * fix: preserve user reasoning effort settings and improve display logic * fix: artifacts code not streaming (#732) * fix: artifact react load failed * chore: remove log * fix: artifacts code not stream * fix: format * feat: disable automatic model enabling for better UX (#734) * feat: sync provider sorting from settings to model selection (#736) * feat: sync provider sorting from settings to model selection * feat: refactor ModelSelect to use computed providers for better reactivity --------- Co-authored-by: yyhhyyyyyy <yyhhyyyyyy8@gmail.com> Co-authored-by: hllshiro <40970081+hllshiro@users.noreply.github.com> Co-authored-by: tomsun28 <tomsun28@outlook.com> Co-authored-by: gongchao <chao.gong@aminer.cn> Co-authored-by: Simon He <57086651+Simon-He95@users.noreply.github.com> Co-authored-by: wanna <wanna.w@binarywalk.com>
Pull Request Description
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
*For example: I'm always frustrated when [...] *
Describe the solution you'd like
A clear and concise description of what you want to happen.
UI/UX changes for Desktop Application
If this PR introduces UI/UX changes, please describe them in detail.
Platform Compatibility Notes
If this PR has specific platform compatibility considerations (Windows, macOS, Linux), please describe them here.
Additional context
Add any other context about the pull request here.
Pull Request Description (中文)
你的功能请求是否与某个问题有关?请描述一下。
请对问题进行清晰扼要的描述。
*例如:我增加了 [...] 的功能 *
请描述你希望的解决方案
请对你希望实现的效果进行清晰扼要的描述。
桌面应用程序的 UI/UX 更改
如果此 PR 引入了 UI/UX 更改,请详细描述它们。
平台兼容性注意事项
如果此 PR 具有特定的平台兼容性考虑因素(Windows、macOS、Linux),请在此处描述。
附加背景
在此处添加关于此 Pull Request 的任何其他背景信息。
Summary by CodeRabbit