TinyMCE pasted links to not honor glide.ui.html.editor.default_link_target
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 10:55 AM
Hello,
I need to change the default behavior of link pasting, as 99% of the time we would like links to open in a new tab, as to not disrupt the current session of the user consuming the article.
There is a property `glide.ui.html.editor.default_link_target` which allows you to set the default target to "_blank" which is perfect, however this only works when a user clicks the "link icon" or types in the URL manually (starting with "www.")
On TinyMCE v5 documentation site for the autolink plugin (reference: https://www.tiny.cloud/docs/plugins/opensource/autolink/) it states that "
Note: Pasted URLs are automatically converted to a elements by TinyMCE’s core code, not by the autolink plugin. Therefore, behaviour and settings described here do not apply to pasted links.
So this seems to be "intended" behavior.
Does anyone have any ideas of things we can do to change this? (some sort of client script to manually change the values on update would not be feasible since we would like to let users specify "none" as the link target if needed).
Under the paste plugin there is a setting called smart_paste, but it does not seem like we have the ability to configure this setting, so that does not seem like an option.
Any help would be appreciated!