From 78ef673fc7f3d3fa4c9be687bbe93e698052220b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Thu, 30 Sep 2021 21:39:13 +0200 Subject: [PATCH] fix lint error --- .../src/lowlight-plugin.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/extension-code-block-lowlight/src/lowlight-plugin.ts b/packages/extension-code-block-lowlight/src/lowlight-plugin.ts index 3ff2351f..25b95556 100644 --- a/packages/extension-code-block-lowlight/src/lowlight-plugin.ts +++ b/packages/extension-code-block-lowlight/src/lowlight-plugin.ts @@ -25,6 +25,11 @@ function parseNodes(nodes: any[], className: string[] = []): { text: string, cla .flat() } +function getHighlightNodes(result: any) { + // `.value` for lowlight v1, `.children` for lowlight v2 + return result.value || result.children || [] +} + function getDecorations({ doc, name, lowlight }: { doc: ProsemirrorNode, name: string, lowlight: any }) { const decorations: Decoration[] = [] @@ -52,11 +57,6 @@ function getDecorations({ doc, name, lowlight }: { doc: ProsemirrorNode, name: s }) }) - function getHighlightNodes(result) { - // `.value` for lowlight v1, `.children` for lowlight v2 - return result.value || result.children || [] - } - return DecorationSet.create(doc, decorations) }