@haklex/rich-renderer-katex
v0.0.106
Published
KaTeX math renderer for haklex rich editor
Readme
@haklex/rich-renderer-katex
KaTeX math expression edit nodes for inline and block-level mathematical typesetting.
Note: This package only provides edit nodes. Static rendering of KaTeX expressions is built into
@haklex/rich-editordirectly.
Installation
pnpm add @haklex/rich-renderer-katexPeer Dependencies
| Package | Version |
| --- | --- |
| lexical | ^0.41.0 |
| @lexical/react | ^0.41.0 |
| react | >=19 |
| react-dom | >=19 |
| katex | >=0.16.0 (optional) |
Usage
import { katexEditNodes } from '@haklex/rich-renderer-katex'
// Register edit nodes in your editor config
const editorConfig = {
nodes: [
...katexEditNodes,
// ...other nodes
],
}Exports
Nodes and Decorators
KaTeXBlockEditNode— Edit node for block-level math expressionsKaTeXInlineEditNode— Edit node for inline math expressionsKaTeXEditDecorator— Shared edit decorator for KaTeX renderingkatexEditNodes— Array of all KaTeX edit nodes for convenient registration
Sub-path Exports
| Path | Description |
| --- | --- |
| @haklex/rich-renderer-katex | Full exports |
| @haklex/rich-renderer-katex/style.css | Stylesheet |
Part of Haklex
This package is part of the Haklex rich editor ecosystem.
License
MIT
