-
|
The $createAutoLinkNode is inserting the link element and the URL, but no link text. I assumed it would happen automatically, but I'm stuck. This is the plugin that is supposed to automatically create a link if you paste a valid URL directly into the editor. I can add regular links just fine, but not the autoLinkNode ones. Here is what I have so far: I also tried manually adding text by create a text node and appending it to the autoLinkNode But this gives me this error: There's not much more that I can explain here. I couldn't find any other way online on how to do this. Google says the URL itself should automatically become the text for the link (as I was expecting). Let me know what I'm doing wrong, and if there is a better way for this function to work (or if I even need a function). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
You should take a look at the react AutoLinkPlugin source. Should be straightforward to port to vanilla js. The $create functions are just constructors that will only ever create a single node, so just the link and no text. Other functions or commands are used for higher-level operations such as $toggleLink. |
Beta Was this translation helpful? Give feedback.
You should take a look at the react AutoLinkPlugin source. Should be straightforward to port to vanilla js. The $create functions are just constructors that will only ever create a single node, so just the link and no text. Other functions or commands are used for higher-level operations such as $toggleLink.