I’m trying to understand how to add a rel="nofollow noopener" attribute to links in the text block when they also have target="_blank" and/or are external links.
I’ve come to the conclusion that links in the text block are rendered in this Vue component of the link mark, with the toDOM() function:
I wanted to ask what are the options to override this behavior, in order to add the rel attribute (if it’s even possible).
Hmm actually I’m using blocks with the text block, which should be made with the “writer” component. Links in there are created using the link mark through the panel editor, and it doesn’t seem that you can add additional attributes there.
Yes, that doesn’t work with writer fields. Is it an option to change the blocktype to “text” or “textarea”? In the template the following seem to work as i mentioned.
Hi @mcont, I’m trying to do the same thing as you or very similar: I want to add the option to add a rel= attribute through a dedicated field in the link dialogs (from writer and textarea toolbars).
What I then discovered (and I consider that an acceptable solution for my use case) is that modern browsers treat target="_blank" links as if they also had the rel="noopener" attribute, so the security issues deriving from not having noopener don’t seem to be an issue anymore.
It’s still not a solution if you need other rel values though, and I’m afraid I can’t really help on that.
All right. That does not cover my use case indeed as I need real values for SEO (adding nofollow to some links). I’m trying to think of something to cover this. Not there yet.