Skip to content

Commit 78ef673

Browse files
committed
fix lint error
1 parent 5cdc10c commit 78ef673

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/extension-code-block-lowlight/src/lowlight-plugin.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ function parseNodes(nodes: any[], className: string[] = []): { text: string, cla
2525
.flat()
2626
}
2727

28+
function getHighlightNodes(result: any) {
29+
// `.value` for lowlight v1, `.children` for lowlight v2
30+
return result.value || result.children || []
31+
}
32+
2833
function getDecorations({ doc, name, lowlight }: { doc: ProsemirrorNode, name: string, lowlight: any }) {
2934
const decorations: Decoration[] = []
3035

@@ -52,11 +57,6 @@ function getDecorations({ doc, name, lowlight }: { doc: ProsemirrorNode, name: s
5257
})
5358
})
5459

55-
function getHighlightNodes(result) {
56-
// `.value` for lowlight v1, `.children` for lowlight v2
57-
return result.value || result.children || []
58-
}
59-
6060
return DecorationSet.create(doc, decorations)
6161
}
6262

0 commit comments

Comments
 (0)