Skip to content

Conversation

@Myranae
Copy link
Contributor

@Myranae Myranae commented Dec 8, 2025

Summary:

Problem

TeX rendering errors were previously displayed in a separate TexErrorView component below the editor, making them easy to overlook and inconsistent with how other content issues are surfaced. This separation meant content creators might miss important TeX syntax problems until later in the authoring process.

Solution

Integrated TeX debugging information into the unified Issues Panel alongside linter warnings and accessibility issues. Created a detectTexErrors() utility that parses content and validates math expressions with KaTeX, then transforms any errors into the standard Issue format. TeX debugging info now appears prominently in the Issues Panel with helpful descriptions and links to documentation, giving content creators a single location to review all content quality concerns.

-> Summary and code changes done with Claude Code <-

Issue: LEMS-3046

Test plan:

  • Confirm all checks pass
  • Manually confirm TeX debugging info appears with incorrect TeX
  • Possibly request content authors test out a ZND to confirm multiple types of potential TeX errors are caught

@Myranae Myranae self-assigned this Dec 8, 2025
@github-actions github-actions bot added schema-change Attached to PRs when we detect Perseus Schema changes in it item-splitting-change labels Dec 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (ff2316a) and published it to npm. You
can install it using the tag PR3097.

Example:

pnpm add @khanacademy/perseus@PR3097

If you are working in Khan Academy's frontend, you can run the below command.

./dev/tools/bump_perseus_version.ts -t PR3097

If you are working in Khan Academy's webapp, you can run the below command.

./dev/tools/bump_perseus_version.js -t PR3097

@github-actions github-actions bot removed the schema-change Attached to PRs when we detect Perseus Schema changes in it label Dec 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

🗄️ Schema Change: No Changes ✅

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

🛠️ Item Splitting: No Changes ✅

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

Size Change: -277 B (-0.06%)

Total Size: 498 kB

Filename Size Change
packages/perseus-editor/dist/es/index.js 97.9 kB -277 B (-0.28%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.8 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 5.98 kB
packages/math-input/dist/es/index.js 99.2 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.item-splitting.js 13.1 kB
packages/perseus-core/dist/es/index.js 24.7 kB
packages/perseus-linter/dist/es/index.js 8.64 kB
packages/perseus-score/dist/es/index.js 9.2 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/index.js 200 kB
packages/perseus/dist/es/strings.js 7.73 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.72 kB

compressed-size-action

@Myranae Myranae marked this pull request as ready for review December 8, 2025 17:34
@Myranae Myranae added the project agnostic PRs reviewable by any Perseus team member label Dec 8, 2025
@github-actions github-actions bot added schema-change Attached to PRs when we detect Perseus Schema changes in it item-splitting-change and removed schema-change Attached to PRs when we detect Perseus Schema changes in it item-splitting-change labels Dec 8, 2025
Copy link
Collaborator

@jeremywiebe jeremywiebe left a comment

Choose a reason for hiding this comment

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

This is great! I left a non-blocking comment about using MathJax for this instead of KaTeX.

@@ -0,0 +1,46 @@
import {preprocessTex, PerseusMarkdown} from "@khanacademy/perseus";
import katex from "katex";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does MathJax provide any features that we could use instead? If I remember correctly, this is the last vestige of KaTeX at Khan Academy. Continuing to use it means that we could be flagging issues that MathJax doesn't have a problem with and/or vice-versa.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we kept it here because KaTeX will find more issues than MathJax will (and we wanted that for a specific reason), and I thought there was still content that used KaTeX, or that content authors still used KaTeX, something like that. I should have tried to get this out before Ben became a pumpkin, but oh well 😅 I'll create a ticket to review the use of KaTeX here and check in with Ben about just switching this to MathJax since I don't remember the relevant context. Does that sound okay for now?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Absolutely. We can come back to this in the new year!

@Myranae Myranae merged commit f0cceb9 into main Dec 8, 2025
11 checks passed
@Myranae Myranae deleted the tb/LEMS-3046/make-tex-bar-pop branch December 8, 2025 19:30
SonicScrewdriver added a commit that referenced this pull request Dec 8, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @khanacademy/[email protected]

### Minor Changes

- [#3091](#3091)
[`27ab0dba64`](27ab0db)
Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Move
the Khanmigo data functions to Perseus Core for Server Side Scoring
initiative

### Patch Changes

- [#3086](#3086)
[`0d1d39b563`](0d1d39b)
Thanks [@nishasy](https://github.com/nishasy)! - Create free response
widget generator for testdata


- [#3098](#3098)
[`7df7755d56`](7df7755)
Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Sync
dependencies

- Updated dependencies
\[[`27ab0dba64`](27ab0db),
[`0d1d39b563`](0d1d39b),
[`7df7755d56`](7df7755)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Minor Changes

- [#3091](#3091)
[`27ab0dba64`](27ab0db)
Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Move
the Khanmigo data functions to Perseus Core for Server Side Scoring
initiative

### Patch Changes

- [#3086](#3086)
[`0d1d39b563`](0d1d39b)
Thanks [@nishasy](https://github.com/nishasy)! - Create free response
widget generator for testdata

## @khanacademy/[email protected]

### Patch Changes

- Updated dependencies
\[[`27ab0dba64`](27ab0db),
[`0d1d39b563`](0d1d39b)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

- Updated dependencies
\[[`27ab0dba64`](27ab0db),
[`0d1d39b563`](0d1d39b)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

- [#3098](#3098)
[`7df7755d56`](7df7755)
Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Sync
dependencies

- Updated dependencies
\[[`27ab0dba64`](27ab0db),
[`0d1d39b563`](0d1d39b)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

- [#3083](#3083)
[`9b4aa293ac`](9b4aa29)
Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Improve
TypeScript (message) types used for previewing


- [#3086](#3086)
[`0d1d39b563`](0d1d39b)
Thanks [@nishasy](https://github.com/nishasy)! - Create free response
widget generator for testdata


- [#3098](#3098)
[`7df7755d56`](7df7755)
Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Sync
dependencies


- [#3097](#3097)
[`f0cceb96ff`](f0cceb9)
Thanks [@Myranae](https://github.com/Myranae)! - Move TeX issues info to
Issues panel

- Updated dependencies
\[[`27ab0dba64`](27ab0db),
[`0d1d39b563`](0d1d39b),
[`7df7755d56`](7df7755)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

- Updated dependencies
\[[`27ab0dba64`](27ab0db),
[`0d1d39b563`](0d1d39b)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

- Updated dependencies
\[[`27ab0dba64`](27ab0db),
[`0d1d39b563`](0d1d39b)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

olc-5.0.b6bfb project agnostic PRs reviewable by any Perseus team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants