Skip to content

fix(katex): 覆盖rehype-katex依赖的katex版本 - #718

Merged
CuteLeaf merged 1 commit into
CuteLeaf:masterfrom
dringsim:katex
Nov 15, 2026
Merged

CuteLeaf merged 1 commit into
CuteLeaf:masterfrom
dringsim:katex

Conversation

@dringsim

@dringsim dringsim commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Type of change

  • Bug fix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (please describe):

Checklist

  • I have read the CONTRIBUTING document.
  • I have checked to ensure that this Pull Request is not for personal changes.
  • I have performed a self-review of my own code.
  • My changes generate no new warnings.

Related Issue

#633

Changes

目前Firefly在astro.config.mjs中向rehypeKatex通过参数传入自定义版本的katex,但根据rehype-katex的文档这样做并不能奏效。本patch改为通过pnpm-workspace.yaml的overrides参数将rehype-katex依赖的katex的版本覆盖掉。(rehype-katex目前有个升级katex的pr但尚未合并)

How To Test

在本地测试了部分公式的渲染效果。

Screenshots (if applicable)

图片

Additional Notes

Sourcery 总结

修复 rehype-katex 的 KaTeX 版本解析问题,以恢复一致的公式渲染效果。

错误修复:

  • 确保 rehype-katex 使用预期的 KaTeX 版本,使数学公式渲染能够使用正确版本的依赖项。

构建:

  • 在整个 pnpm 工作区中覆盖 KaTeX 依赖版本,并更新锁文件。
Original summary in English

Summary by Sourcery

Fix KaTeX version resolution for rehype-katex to restore consistent formula rendering.

Bug Fixes:

  • Ensure rehype-katex uses the intended KaTeX version so mathematical formula rendering receives the correct dependency version.

Build:

  • Override the KaTeX dependency version across the pnpm workspace and update the lockfile.

@netlify

netlify Bot commented Nov 13, 2026

Copy link
Copy Markdown

👷 Deploy request for demo-firefly pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit abe451f

@sourcery-ai

sourcery-ai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

审阅者指南

配置

覆盖 rehype-katex 使用的 KaTeX 版本,并移除无效的自定义 KaTeX 选项,同时在锁文件中记录依赖解析结果。

  • astro.config.mjs L17(已删除的行)、L304
  • pnpm-lock.yaml L7-12522(7 处小改动)
  • pnpm-workspace.yaml L6-7

提示和命令

与 Sourcery 交互

  • 触发新的审阅: 在拉取请求中评论 @sourcery-ai review。
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 根据审阅评论创建 GitHub issue: 回复某条审阅评论,请 Sourcery 根据该评论创建 issue。你也可以在审阅评论中回复 @sourcery-ai issue 来创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,随时(重新)生成标题。
  • 生成拉取请求摘要: 在拉取请求正文的任意位置写入 @sourcery-ai summary,即可随时在指定位置生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,随时(重新)生成摘要。
  • 生成审阅者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,这会很有用。
  • 撤销所有 Sourcery 审阅: 在拉取请求中评论 @sourcery-ai dismiss,即可撤销所有现有的 Sourcery 审阅。如果你想从头开始进行新的审阅,这尤其有用——别忘了评论 @sourcery-ai review 来触发新的审阅!

自定义使用体验

访问你的控制面板,即可:

  • 启用或禁用审阅功能,例如 Sourcery 生成的拉取请求摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、移除或编辑自定义审阅说明。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide

Configuration

Override the KaTeX version used by rehype-katex and remove the ineffective custom KaTeX option, with the lockfile recording the dependency resolution.

  • astro.config.mjs L17 (removed lines), L304
  • pnpm-lock.yaml L7-12522 (7 small edits)
  • pnpm-workspace.yaml L6-7

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai

sourcery-ai Bot commented Nov 13, 2026

Copy link
Copy Markdown

关联问题

在提交 abe451f 时检查

#633 [错误]: Katex所有内容字体大小一致 · 1 项要求中有 1 项满足

# 要求 状态 备注
1 KaTeX 公式中的上下标和其他内容应按预期呈现不同的字体大小,避免重叠。 ✅ 已满足 pnpm override 将 rehype-katex 使用的 KaTeX 固定为 0.19.1;lockfile 确认其依赖解析到该版本,配置也不再向 rehypeKatex 传入无效的自定义实例。
Original linked issues in English

Linked issues

Checked at commit abe451f

#633 [Bug]: Katex所有内容字体大小一致 · 1 of 1 met

# Requirement Status Notes
1 KaTeX公式中的上下标和其他内容应按预期呈现不同字体大小,避免重叠。 ✅ Met pnpm override 将 rehype-katex 使用的 KaTeX 固定到 0.19.1;lockfile 确认其依赖解析到该版本,配置也不再向 rehypeKatex 传入无效的自定义实例。

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你好——我已经审阅了你的更改,整体看起来很棒!

Sourcery 评估

已批准。


Sourcery 为开源项目免费提供服务——如果你喜欢我们的评审,欢迎考虑分享 ✨
Original comment in English

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@CuteLeaf
CuteLeaf merged commit 908e7d7 into CuteLeaf:master Nov 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants