Skip to content

Enhance editor with KaTeX support for math rendering.#118

Open
oupadhyay wants to merge 1 commit into
UdaraJay:mainfrom
oupadhyay:feature/latex-math-extension
Open

Enhance editor with KaTeX support for math rendering.#118
oupadhyay wants to merge 1 commit into
UdaraJay:mainfrom
oupadhyay:feature/latex-math-extension

Conversation

@oupadhyay

Copy link
Copy Markdown

Hey again, this PR resolves #57.

It does the following:

  • Use @aarkue/tiptap-math-extension package for TipTap Editor Math Rendering.
  • Added new CSS variables for code styling with light & dark mode values.
  • Improve preview from div to read-only editor.

@oupadhyay

Copy link
Copy Markdown
Author
image

- Use @aarkue/tiptap-math-extension package for TipTap Editor Math Rendering.
- Added new CSS variables for code styling with light & dark mode values.
- Improve preview from div to read-only editor.
@oupadhyay oupadhyay force-pushed the feature/latex-math-extension branch from 3df138e to 6611891 Compare June 8, 2025 09:12
@UdaraJay UdaraJay requested a review from Copilot June 11, 2025 16:22

Copilot AI 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.

Pull Request Overview

This PR integrates KaTeX-based math rendering into the TipTap editor and preview, refactors code block styling to use CSS variables, and updates build scripts and dependencies.

  • Add @aarkue/tiptap-math-extension and KaTeX styling for in-editor and read-only previews
  • Replace raw HTML preview with a read-only TipTap editor instance
  • Introduce --code-primary CSS variable and adjust build scripts/dependencies

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

File Description
src/renderer/pages/Pile/Editor/index.jsx Integrated MathExtension, created a read-only editor for preview, replaced dangerouslySetInnerHTML with EditorContent
src/renderer/pages/Pile/Editor/ProseMirror.scss Updated code block styles to use --code-primary variable
src/renderer/App.scss Defined --code-primary for light and dark themes
package.json Switched build script to pnpm, added KaTeX and math-extension dependencies, updated module mapping and versions
Comments suppressed due to low confidence (4)

src/renderer/pages/Pile/Editor/index.jsx:173

  • There are no tests verifying that the read-only editor correctly renders KaTeX math content. Adding unit or integration tests for math blocks in preview mode would help guard against regressions.
const readOnlyEditor = useEditor({

src/renderer/pages/Pile/Editor/index.jsx:177

  • The Link extension is referenced in the read-only editor config but not imported. Please add import Link from '@tiptap/extension-link'; at the top to prevent a ReferenceError.
Link,

src/renderer/pages/Pile/Editor/index.jsx:127

  • [nitpick] The same extensions array (StarterKit, Typography, MathExtension, etc.) is duplicated for editable and read-only editors. Consider extracting the shared extensions into a constant to reduce duplication and simplify future updates.
MathExtension.configure({

package.json:30

  • [nitpick] The build script now uses pnpm instead of npm. Please verify that this matches the project's documented package manager and update any onboarding/docs to prevent contributor confusion.
"build": "concurrently \"pnpm run build:main\" \"pnpm run build:renderer\"",

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.

Markdown latex compatibility

2 participants