Enhance editor with KaTeX support for math rendering.#118
Open
oupadhyay wants to merge 1 commit into
Open
Conversation
Author
- 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.
3df138e to
6611891
Compare
There was a problem hiding this comment.
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-extensionand KaTeX styling for in-editor and read-only previews - Replace raw HTML preview with a read-only TipTap editor instance
- Introduce
--code-primaryCSS 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
Linkextension is referenced in the read-only editor config but not imported. Please addimport 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
pnpminstead ofnpm. 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\"",
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Hey again, this PR resolves #57.
It does the following:
@aarkue/tiptap-math-extensionpackage for TipTap Editor Math Rendering.