fix lint error

This commit is contained in:
Philipp Kühn 2021-09-30 21:35:51 +02:00
parent f79347e128
commit d4e70619ae

View File

@ -25,6 +25,11 @@ function parseNodes(nodes: any[], className: string[] = []): { text: string, cla
.flat() .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 }) { function getDecorations({ doc, name, lowlight }: { doc: ProsemirrorNode, name: string, lowlight: any }) {
const decorations: Decoration[] = [] const decorations: Decoration[] = []
@ -51,11 +56,6 @@ function getDecorations({ doc, name, lowlight }: { doc: ProsemirrorNode, name: s
from = to from = to
}) })
}) })
function getHighlightNodes(result) {
// `.value` for lowlight v1, `.children` for lowlight v2
return result.value || result.children || []
}
return DecorationSet.create(doc, decorations) return DecorationSet.create(doc, decorations)
} }