You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
When using an async function as an
onPaste
handler in a tool, the tool'spasteConfig
is not recognized by editor.js. The problem is this check here. The functionisFunction
returnsfalse
for async functions. And this is because the functiontypeof
returns the stringasyncfunction
instead offunction
. In my opinion, the implementation ofisFunction
is wrong. It should returntrue
for async functions, because async functions are functions, too.Steps to reproduce:
onPaste
handler is an async functionpasteConfig
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.
The text was updated successfully, but these errors were encountered: