- Create a file
Image.js
from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that acceptsuploadFunc
(function to be called withimage
being uploaded) and additional logicif(upload) { ... } else { ... previous base64 logic .. }
in thenew Plugin
section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'
/**
* Matches following attributes in Markdown-typed image: [, alt, src, title]
*