Skip to content

Commit 07c9518

Browse files
fix: add missing type and missing documentation in README
1 parent c7bd463 commit 07c9518

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ You can provide your own React components to the renderer, both for blocks and m
4040

4141
- **Blocks** are full-width elements, usually at the root of the content. The available options are:
4242
- paragraph
43-
- heading (receives `level`)
43+
- heading (receives `level` and `plainText`)
4444
- list (receives `format`)
4545
- quote
4646
- code (receives `plainText`)

src/BlocksRenderer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ type Node = RootNode | NonTextInlineNode;
8888
type GetPropsFromNode<T> = Omit<T, 'type' | 'children'> & {
8989
children?: React.ReactNode;
9090
// For code blocks, add a plainText property that is created by this renderer
91-
plainText?: T extends { type: 'code' } ? string : never;
91+
plainText?: T extends { type: 'code' | 'heading' } ? string : never;
9292
};
9393

9494
// Map of all block types to their matching React component

0 commit comments

Comments
 (0)