-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
Description
When using an async function as an onPaste
handler in a tool, the tool's pasteConfig
is not recognized by editor.js. The problem is this check here. The function isFunction
returns false
for async functions. And this is because the function typeof
returns the string asyncfunction
instead of function
. In my opinion, the implementation of isFunction
is wrong. It should return true
for async functions, because async functions are functions, too.
Steps to reproduce:
- Import a tool whose
onPaste
handler is an async function - Paste something that matches the tool's
pasteConfig
Behavior: The pasted content is pasted inside a new default block.
Expected behavior: The pasted content should be pasted inside a new block of the imported tool.