mirror of
https://github.com/zadam/trilium.git
synced 2025-11-14 09:15:50 +01:00
chore(ckeditor5/plugins): integrate markdown inline
This commit is contained in:
25
packages/ckeditor5/src/plugins/markdownimport.ts
Normal file
25
packages/ckeditor5/src/plugins/markdownimport.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { ButtonView, Plugin } from 'ckeditor5';
|
||||
import markdownIcon from '../icons/markdown-mark.svg?raw';
|
||||
|
||||
export default class MarkdownImportPlugin extends Plugin {
|
||||
init() {
|
||||
const editor = this.editor;
|
||||
|
||||
editor.ui.componentFactory.add( 'markdownImport', locale => {
|
||||
const view = new ButtonView( locale );
|
||||
|
||||
view.set( {
|
||||
label: 'Markdown import from clipboard',
|
||||
icon: markdownIcon,
|
||||
tooltip: true
|
||||
} );
|
||||
|
||||
// Callback executed once the image is clicked.
|
||||
view.on( 'execute', () => {
|
||||
glob.importMarkdownInline();
|
||||
} );
|
||||
|
||||
return view;
|
||||
} );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user