import { nodeInputRule as t } from "@tiptap/core"
import { FileBase as e } from "./file-base.js"
import { NODE_TYPE as r } from "../constants.js"
const s = /!\[(.+|:?)\]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/
export const FileImage = e.extend({
name: r.FILE_IMAGE,
addInputRules() {
return [
t({
find: s,
type: this.type,
getAttributes: (t) => {
const [, e, r, s] = t
return { src: r, alt: e, title: s }
},
}),
]
},
})