Skip to content

Paste image from clipboard #404

Closed Answered by dmitry-udod
dmitry-udod asked this question in Q&A
Discussion options

You must be logged in to vote

Here is a raw example of custom extension:

extensions.js

import EventHandler from "./eventHandler.js";

window.TiptapEditorExtensions = {
    eventHandler: [EventHandler],
}

eventHandler.js

import { Extension } from "@tiptap/core";
import { Plugin, PluginKey } from '@tiptap/pm/state'

const ALLOWED_MIME_TYPES = [
    'image',
    'application/msword', // .doc
    'application/vnd.openxmlformats-officedocument.wordprocessingml.document', // docx
    'application/pdf', // pdf
    'application/vnd.ms-powerpoint', // ppt
    'application/vnd.openxmlformats-officedocument.presentationml.presentation', // pptx
    'application/rtf', // rtf
    'text/plain', // txt
    'application/vnd.ms-excel', 

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@dmitry-udod
Comment options

Comment options

You must be logged in to vote
1 reply
@awcodes
Comment options

Answer selected by dmitry-udod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants