fix editor file handling

This commit is contained in:
Philipinho
2024-06-22 03:33:54 +01:00
parent 2aec5a3fe7
commit df1840cf67
12 changed files with 71 additions and 75 deletions

View File

@ -28,8 +28,6 @@ declare module "@tiptap/core" {
}
}
const VIDEO_INPUT_REGEX = /!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/;
export const TiptapVideo = Node.create<VideoOptions>({
name: "video",
@ -123,23 +121,10 @@ export const TiptapVideo = Node.create<VideoOptions>({
return ReactNodeViewRenderer(this.options.view);
},
addInputRules() {
return [
nodeInputRule({
find: VIDEO_INPUT_REGEX,
type: this.type,
getAttributes: (match) => {
const [, , src] = match;
return { src };
},
}),
];
},
addProseMirrorPlugins() {
return [
VideoUploadPlugin({
placeHolderClass: "video-upload",
placeholderClass: "video-upload",
}),
];
},