mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-10 05:58:13 +08:00
38f3601e6f
This reverts commit 7e96d98a21
.
25 lines
589 B
TypeScript
25 lines
589 B
TypeScript
import lowlight from 'lowlight/lib/core'
|
|
import CodeBlock, { CodeBlockOptions } from '@tiptap/extension-code-block'
|
|
import { LowlightPlugin } from './lowlight-plugin'
|
|
|
|
export interface CodeBlockLowlightOptions extends CodeBlockOptions {
|
|
lowlight: any,
|
|
}
|
|
|
|
export const CodeBlockLowlight = CodeBlock.extend<CodeBlockLowlightOptions>({
|
|
defaultOptions: {
|
|
...CodeBlock.options,
|
|
lowlight,
|
|
},
|
|
|
|
addProseMirrorPlugins() {
|
|
return [
|
|
...this.parent?.() || [],
|
|
LowlightPlugin({
|
|
name: 'codeBlock',
|
|
lowlight: this.options.lowlight,
|
|
}),
|
|
]
|
|
},
|
|
})
|