Skip to content

fix: ignore nested KaTeX tables for line highlights (fix #2559)#2596

Closed
MapleQiAN wants to merge 1 commit into
slidevjs:mainfrom
MapleQiAN:fix-katex-line-highlighting
Closed

fix: ignore nested KaTeX tables for line highlights (fix #2559)#2596
MapleQiAN wants to merge 1 commit into
slidevjs:mainfrom
MapleQiAN:fix-katex-line-highlighting

Conversation

@MapleQiAN
Copy link
Copy Markdown

Description

Fixes KaTeX line highlighting when display math contains nested KaTeX tables, such as pmatrix or substack. The highlighter now maps click ranges from only the top-level equation table, so nested matrix rows no longer shift the outer equation line count.

Fix #2559

Tests

  • pnpm vitest run packages\client\logic\katex.test.ts
  • pnpm vitest run packages\slidev\node\syntax\katex.test.ts
  • pnpm eslint packages/client/logic/katex.ts packages/client/logic/katex.test.ts packages/client/builtin/KaTexBlockWrapper.vue
  • git diff --check

pnpm typecheck still fails in existing docs/node_modules/vitepress files because some distributed .js modules do not have declarations.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 13, 2026

Deploy Preview for slidev ready!

Name Link
🔨 Latest commit 6e20c3b
🔍 Latest deploy log https://app.netlify.com/projects/slidev/deploys/6a0419d8241a6100081eb52a
😎 Deploy Preview https://deploy-preview-2596--slidev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@kermanx
Copy link
Copy Markdown
Member

kermanx commented May 13, 2026

#2579?

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 13, 2026

Open in StackBlitz

@slidev/client

npm i https://pkg.pr.new/@slidev/client@2596

create-slidev

npm i https://pkg.pr.new/create-slidev@2596

create-slidev-theme

npm i https://pkg.pr.new/create-slidev-theme@2596

@slidev/parser

npm i https://pkg.pr.new/@slidev/parser@2596

@slidev/cli

npm i https://pkg.pr.new/@slidev/cli@2596

@slidev/types

npm i https://pkg.pr.new/@slidev/types@2596

commit: 6e20c3b

@MapleQiAN MapleQiAN closed this May 13, 2026
@MapleQiAN MapleQiAN deleted the fix-katex-line-highlighting branch May 13, 2026 12:12
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.

Latex Line Highlighting broken

2 participants