Skip to content

Commit

Permalink
docs(figure): pass an object to nodeInputRule
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhhashemi authored and Arman Hashemi committed Jul 6, 2022
1 parent 9e84353 commit fd937fc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions demos/src/Experiments/Figure/Vue/figure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,14 @@ export const Figure = Node.create<FigureOptions>({

addInputRules() {
return [
nodeInputRule(inputRegex, this.type, match => {
const [, alt, src, title] = match

return { src, alt, title }
nodeInputRule({
find: inputRegex,
type: this.type,
getAttributes: match => {
const [, src, alt, title] = match

return { src, alt, title }
},
}),
]
},
Expand Down

0 comments on commit fd937fc

Please sign in to comment.