From c8037b6c9d2a763aae39b405d0f62d9e94cf5c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Thu, 3 Jun 2021 09:42:15 +0200 Subject: [PATCH 1/2] debug --- .../extension-code-block-lowlight/src/lowlight-plugin.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/extension-code-block-lowlight/src/lowlight-plugin.ts b/packages/extension-code-block-lowlight/src/lowlight-plugin.ts index 02295ea6..a9cee746 100644 --- a/packages/extension-code-block-lowlight/src/lowlight-plugin.ts +++ b/packages/extension-code-block-lowlight/src/lowlight-plugin.ts @@ -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 From 4d83e56ff53bed9373a521cd184a57a6254253ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Thu, 3 Jun 2021 09:51:30 +0200 Subject: [PATCH 2/2] debug --- docs/src/demos/Nodes/CodeBlockLowlight/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/demos/Nodes/CodeBlockLowlight/index.vue b/docs/src/demos/Nodes/CodeBlockLowlight/index.vue index cea49657..a97e9031 100644 --- a/docs/src/demos/Nodes/CodeBlockLowlight/index.vue +++ b/docs/src/demos/Nodes/CodeBlockLowlight/index.vue @@ -16,7 +16,7 @@ import Text from '@tiptap/extension-text' import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight' // load all highlight.js languages -import { lowlight } from 'lowlight' +import { lowlight } from 'lowlight/lib/all' // load specific languages only // import { lowlight } from 'lowlight/lib/core'