1
+ import {
2
+ buildMarksTree ,
3
+ isPortableTextBlock ,
4
+ isPortableTextListItemBlock ,
5
+ isPortableTextToolkitList ,
6
+ isPortableTextToolkitSpan ,
7
+ isPortableTextToolkitTextNode ,
8
+ nestLists ,
9
+ spanToPlainText ,
10
+ type ToolkitNestedPortableTextSpan ,
11
+ type ToolkitTextNode ,
12
+ } from '@portabletext/toolkit'
1
13
import type {
2
14
ArbitraryTypedObject ,
3
15
PortableTextBlock ,
@@ -6,30 +18,19 @@ import type {
6
18
PortableTextSpan ,
7
19
TypedObject ,
8
20
} from '@portabletext/types'
21
+
22
+ import { defaultComponents } from './components/defaults'
23
+ import { mergeComponents } from './components/merge'
24
+ import { escapeHTML } from './escape'
9
25
import type {
26
+ HtmlPortableTextList ,
10
27
MissingComponentHandler ,
11
28
NodeRenderer ,
12
29
PortableTextHtmlComponents ,
13
30
PortableTextOptions ,
14
- HtmlPortableTextList ,
15
31
Serializable ,
16
32
SerializedBlock ,
17
33
} from './types'
18
- import {
19
- buildMarksTree ,
20
- isPortableTextBlock ,
21
- isPortableTextListItemBlock ,
22
- isPortableTextToolkitList ,
23
- isPortableTextToolkitSpan ,
24
- isPortableTextToolkitTextNode ,
25
- nestLists ,
26
- spanToPlainText ,
27
- ToolkitNestedPortableTextSpan ,
28
- ToolkitTextNode ,
29
- } from '@portabletext/toolkit'
30
- import { defaultComponents } from './components/defaults'
31
- import { mergeComponents } from './components/merge'
32
- import { escapeHTML } from './escape'
33
34
import {
34
35
printWarning ,
35
36
unknownBlockStyleWarning ,
@@ -113,6 +114,7 @@ const getNodeRenderer = (
113
114
let children = tree . children
114
115
if ( node . style && node . style !== 'normal' ) {
115
116
// Wrap any other style in whatever the block component says to use
117
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
116
118
const { listItem, ...blockNode } = node
117
119
children = renderNode ( { node : blockNode , index, isInline : false , renderNode} )
118
120
}
@@ -164,6 +166,7 @@ const getNodeRenderer = (
164
166
}
165
167
166
168
function renderBlock ( node : PortableTextBlock , index : number , isInline : boolean ) : string {
169
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
167
170
const { _key, ...props } = serializeBlock ( { node, index, isInline, renderNode} )
168
171
const style = props . node . style || 'normal'
169
172
const handler =
0 commit comments