mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 09:25:29 +08:00
Merge branch 'main' of https://github.com/ueberdosis/tiptap
# Conflicts: # packages/extension-code-block-lowlight/src/lowlight-plugin.ts
This commit is contained in:
commit
5cdc10ce67
@ -25,11 +25,6 @@ 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[] = []
|
||||
|
||||
@ -57,6 +52,11 @@ 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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user