docs(figure): pass an object to nodeInputRule (#2954)

This commit is contained in:
ahhshm 2022-07-07 00:28:55 +04:30 committed by GitHub
parent edb2291efc
commit e2f8747e2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,10 +180,14 @@ export const Figure = Node.create<FigureOptions>({
addInputRules() {
return [
nodeInputRule(inputRegex, this.type, match => {
const [, alt, src, title] = match
nodeInputRule({
find: inputRegex,
type: this.type,
getAttributes: match => {
const [, src, alt, title] = match
return { src, alt, title }
return { src, alt, title }
},
}),
]
},