Describe the bug
There is no way for plugin authors to extend the link popup overlay options presented (regression from TinyMCE). This is a particularly important regression, as WordPress Core removed several options from the link editor in recent years to streamline the editing process, relying on a plugins to restore these features using the hooks available.
Additionally the classic editor, plugin authors can extend the link options presented in the overlay to add custom attributes and other link settings, such as this one. While WordPress shouldn't necessarily consider expanding the link options it provides with Gutenberg, it should allow plugins to extend those link options to support new options and provide backwards compatibility for WordPress Core removed features.
This would likely require filters be added to gutenberg/packages/format-library/src/link/inline.js.
This limitation of Gutenberg also will prevent a lot of plugins from being able to update to support it and as mentioned causes a regression for those using plugins to support the old WordPress attribute behaviors.
There are a lot of really common attributes that various plugins add to links via the existing editor's link options including the ability to toggle on the download
attribute for download links, nofollow
on links, and so forth.
Gutenberg should provide parity in hooks here, for display of additional settings, the application of those attributes on changes, and saving of them. Basically there's just hooks needed, with a dedicated slot for plugins to add their settings onto.
Related tickets, many of which would be solved directly by the resolution of this ticket or indirectly by allowing for plugins to be easily made for them include: #10226, #4499, #4597, #11484, #2474, #11471, #11440, #10225, #8711, and #6392
+1 for this. We regularly ask clients for feedback on their Gutenberg experience and ~90% of the responses mention a lack of nofollow or ability to add a rel attribute to links easily.
"I'm finding Gutenburg ok actually. It took me a bit of time to get the hang of it though the idea of blocks is something I worked with when I was on Squarespace. One thing I've realised though is my 'rel-nofollow' plugin won't work with it which is a nuisance and I'm not sure of a solution. I can't code so wouldn't be messing with HTML. Apart from that I'm fine with it."
We've been trying to raise this issue for months now but there hasn't been any traction. If there was a standardized way to extend the link popup we could quickly solve issues such as #4597 and #4499 as well as others mentioned by chriscct7 above.
+1 from me too. Most of my clients use affiliate links, and they need the ability to make links "nofollow" in order to stay compliant with Google policy. (Most of my clients would be unwilling or unable to edit the HTML manually to add the rel='nofollow' tag). This alone is reason enough for them to avoid using Gutenberg.
I agree and there are other relevant reasons such as the need to include aria-label or title attributes for accessibility of screen readers or what if you simply wanted to be able to easily add a class name to a link.
Just switched to the Gutenberg Editor on my blog, and this is an extremely important feature that's missing. Sure there's a way to do a short-term JS hack, but I feel that this needs to be done in Gutenberg core.
Totally agree with and echo the above comments that this feature is 100% necessary and it baffles me that it isn't included in the core features of Gutenberg. The ability to add nofollow to button links is a necessary feature to include as well.
With https://webmasters.googleblog.com/2019/09/evolving-nofollow-new-ways-to-identify.html, even more reason for this, as plugins could add these types of options easily
I would like to add a +1 to adding at least an aria-label attribute to the link creation UI for accessibility purposes. It would be very useful in cases where the same link text (i.e. the dreaded "Read more") is on the same page multiple times going to different locations.
Most helpful comment
+1 from me too. Most of my clients use affiliate links, and they need the ability to make links "nofollow" in order to stay compliant with Google policy. (Most of my clients would be unwilling or unable to edit the HTML manually to add the rel='nofollow' tag). This alone is reason enough for them to avoid using Gutenberg.