Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Feature]: 内置 Markdown 查看器/编辑器支持数学公式(KaTeX)渲染

Open
#1,952 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
react, typescript
Domain
desktop, frontend

Research direction

Start with src/web-ui/src/component-library/components/Markdown/Markdown.tsx and MarkdownMathRenderer.tsx to understand the existing chat math path, then inspect MarkdownEditor.tsx and src/web-ui/src/tools/editor/meditor/extensions/. Compare the two entry points and run the Markdown viewer with the provided formulas. Done means inline and block math render in opened .md files while dollar signs inside code blocks remain unchanged.

Written by the indexing model from the issue text.

Description

feature good first issue
Problem / opportunity

BitFun 内置的 Markdown 查看器/编辑器(打开 .md 文件时使用)不渲染数学公式,$...$$$...$$ 只显示为原始文本;而对话(chat)中的 Markdown 已经支持 KaTeX 公式渲染。两者渲染能力不一致。

对以 Markdown + LaTeX 记笔记的用户(如数学/理科笔记)影响较大:在 BitFun 内打开自己的笔记看不到公式渲染,只能借助外部编辑器,或自行编写 MiniApp 阅读器绕过。

根因(源码层面):BitFun 内部有两套独立的 Markdown 渲染路径——

  1. 对话渲染(已支持公式):src/web-ui/src/component-library/components/Markdown/Markdown.tsx 通过 mayContainMarkdownMath() 检测 $$ / \( / \[ / 行内 $...$,命中后懒加载 MarkdownMathRenderer.tsx(react-markdown + remark-gfm + remark-math + rehype-katex)。
  2. 文件查看器/编辑器(不支持):打开 .md 走 FileViewerScene → ContentCanvas → MarkdownEditorsrc/web-ui/src/tools/editor/components/MarkdownEditor.tsx),底层是 tiptap 编辑器(src/web-ui/src/tools/editor/meditor/),其 extensions/ 只有 Alignment / Image / Table 扩展,没有任何数学公式扩展。
Proposed behavior

文件查看器/编辑器的预览能像对话一样渲染行内($...$\(...\))与块级($$...$$\[...\])数学公式。

建议方案(任选其一或结合):

  • 为 tiptap 编辑器(meditor)增加数学节点扩展(社区已有成熟的 tiptap + KaTeX 扩展可参考),复用现有 KaTeX 依赖;
  • 或让文件预览复用 component-library 的 Markdown + MarkdownMathRenderer 渲染路径,统一两套渲染的公式能力。
Product surface

Desktop app

Details, examples, or constraints

复现步骤:

  1. 工作区放一个含公式的 .md 文件,例如:质能方程 $E=mc^2$,以及 $$\int_0^1 x^2 dx = \frac13$$
  2. 在 BitFun 内打开该文件(文件查看器)→ 公式原样显示,未渲染
  3. 对比:把同样内容让 AI 在对话中输出 → 公式正常渲染

验收标准:

  • 打开含 $...$ / $$...$$ 的 .md 文件,公式以排版形式渲染
  • 代码块内的 $ 不被误判为公式

环境:Windows 11,BitFun 桌面版。

Dominant language
Rust
Stars
2.3k
Forks
236
Avg merge
2h 56m
Merged PRs (30d)
619

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GCWing/OpenBitFun

All issues in GCWing/OpenBitFun

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.