Add a Custom Block for Katex (fixes #741)#2019
Add a Custom Block for Katex (fixes #741)#2019Excellencedev wants to merge 1 commit intoTypeCellOS:mainfrom
Conversation
|
@Excellencedev is attempting to deploy a commit to the TypeCell Team on Vercel. A member of the Team first needs to authorize it. |
|
Please review this PR and drop a comment so that I know what I need to do |
|
Please approve the workflow and try to review this PR (it fixes #741) @nperez0111 @YousefED |
|
I don't think we are going to accept this PR @Excellencedev, there were other attempts before you, and none were satisfactory. I made my own version a few weeks ago & even it was not satisfactory: #1987 We are likely going to move in a different direction with this. I'm unsure how this works, maybe you should take down the bounty @YousefED ? |
ok thanks |
/claim #741
/fixes #741
Description:
Custom Block for KaTeX Equations (#741)
This PR adds a new custom block for rendering LaTeX equations using KaTeX, addressing the feature request in #741. The block provides a user-friendly interface for inputting and editing mathematical expressions directly in the editor, similar to Notion's equation feature.
Changes
New Block Implementation: Added
packages/core/src/blocks/Equation/block.tsdefining the equation block spec.props.latex.<div class="equation" data-latex="...">from HTML.Integration:
packages/core/src/blocks/index.ts.defaultBlockSpecsinpackages/core/src/blocks/defaultBlocks.tsfor default schema inclusion.defaultBlocks.tsfrom the Equation block file.Dependencies: Added
katexto@blocknote/coredependencies for rendering.Keyboard Shortcut: Cmd/Ctrl + Alt + E to insert a new equation block at the cursor position.
TypeScript Fixes: Adjusted spec structure using
createBlockSpecwith proper overloads to resolve type errors.Usage