Skip to content

Commit

Permalink
fix: Paste rules into notebooks (#18756)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Nov 20, 2023
1 parent 39967ba commit 619c759
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions frontend/src/scenes/notebooks/Nodes/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ export function posthogNodePasteRule(options: {
handler: ({ match, chain, range }) => {
if (match.input) {
chain().deleteRange(range).run()
const attributes = options.getAttributes(match)
if (attributes) {
options.editor.commands.insertContent({
type: options.type.name,
attrs: attributes,
})
}

void Promise.resolve(options.getAttributes(match)).then((attributes) => {
if (attributes) {
options.editor.commands.insertContent({
type: options.type.name,
attrs: attributes,
})
}
})
}
},
})
Expand Down

0 comments on commit 619c759

Please sign in to comment.