fix: fix lowlight decorations for vue 3
This commit is contained in:
@@ -1,11 +1,24 @@
|
||||
import CodeBlock from '@tiptap/extension-code-block'
|
||||
import lowlight from 'lowlight/lib/core'
|
||||
import CodeBlock, { CodeBlockOptions } from '@tiptap/extension-code-block'
|
||||
import { LowlightPlugin } from './lowlight-plugin'
|
||||
|
||||
export const CodeBlockLowlight = CodeBlock.extend({
|
||||
export interface CodeBlockLowlightOptions extends CodeBlockOptions {
|
||||
lowlight: any,
|
||||
}
|
||||
|
||||
export const CodeBlockLowlight = CodeBlock.extend<CodeBlockLowlightOptions>({
|
||||
defaultOptions: {
|
||||
...CodeBlock.config.defaultOptions,
|
||||
lowlight,
|
||||
},
|
||||
|
||||
addProseMirrorPlugins() {
|
||||
return [
|
||||
...this.parentConfig.addProseMirrorPlugins?.() || [],
|
||||
LowlightPlugin({ name: 'codeBlock' }),
|
||||
LowlightPlugin({
|
||||
name: 'codeBlock',
|
||||
lowlight: this.options.lowlight,
|
||||
}),
|
||||
]
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user