We know we released a lot of new functionality in our TinyMCE 4.4 update, so we thought it would be helpful to dive further into some of the new features, and provide more detail in addition to what was in our original post.
We’re going to start with Smartpaste, and you can expect to see blog posts in the near future on other features in 4.4.
Before the release of TinyMCE 4.4, a URL that was copied from a browser and pasted into the editor would show up as the hyperlinked text of the URL. Like so:
However, with the Smartpaste functionality in TinyMCE 4.4, when you paste a URL, the editor will analyze it and determine if that URL represents an image.
If the editor decides – “Yep, that’s an image!” – instead of pasting the URL text, the editor will now paste in the image itself.
And if you were to open up the code editor, you’d see that TinyMCE created a proper image tag around the URL.
In addition to pasting the image, TinyMCE simultaneously creates an extra ‘undo’ level. So if you paste the image and decide you’d rather have the URL text, ‘undo’ once.
And if you then think, “Nah, I don’t think I want anything there at all,” just hit ‘undo’ again, and the URL text disappears.
Some additional notes:
- Smartpaste is part of the Paste and PowerPaste plugins, and is turned on by default.
- If the editor determines that there is not a single image behind the URL, or if the editor can’t tell for sure what the URL represents, the editor will only paste in the URL text, making it a hyperlink if possible.
- While we’ve shown the Smartpaste functionality in the screenshots above on its own line for the sake of clarity, Smartpaste will work anywhere within the editor.
- If you ultimately decide you’d like to disable this functionality, no hard feelings. Just follow these steps.
If there’s other functionality you’d like to see in our Feature Spotlight, please let us know!