This commit is contained in:
Philipp Kühn
2021-06-03 09:42:15 +02:00
parent 7e7af06806
commit c8037b6c9d

View File

@@ -2,6 +2,7 @@ import { Plugin, PluginKey } from 'prosemirror-state'
import { Decoration, DecorationSet } from 'prosemirror-view'
import { Node as ProsemirrorNode } from 'prosemirror-model'
import { findChildren } from '@tiptap/core'
import { lowlight as lowlightAll } from 'lowlight'
function parseNodes(nodes: any[], className: string[] = []): { text: string, classes: string[] }[] {
return nodes
@@ -43,6 +44,11 @@ function getDecorations({ doc, name, lowlight }: { doc: ProsemirrorNode, name: s
nodes,
})
console.log({
lowlightAll,
languages: lowlightAll.listLanguages(),
})
parseNodes(nodes).forEach(node => {
const to = from + node.text.length