-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add aria-label="link text - new window" attribute in <a> tag when "open in new window" is checked #4450
Comments
Hi, If guess we have to be consistent with the rest of WordPress core. This issue seems to be related to https://core.trac.wordpress.org/ticket/23432#comment:53 where we can see the current pattern is something like:
In addition, a good practice should be to add Moreover, it is more or less what is used in Gutenberg external link component:
😊 |
Yep, it would be great to help produce more accessible links in the content. Couple things about the text to use:
|
Sorry, |
Ok. Here is an example of HTML markup for target blank links:
I kicked out the Are we ok to say this is a clean way to manage these links? Is so, I'll work on an integration in G. this week 😃 |
If possible, a space before the opening parenthesis would be 👍 Also, a while ago someone pointed out that "in a new window" isn't 100% correct, as many browsers open a new tab by default. It also depends on the browser settings, could be a new tab or new window. I guess consistency with the wording already used in core is more important though. |
Closing since the option has been removed |
Reopening since the option has been restored in #6028 |
@afercia I have been looking into this and it seems that inserting the span into the markup is not ( as far as I can tell ) possible using the API that is handling turning the text into the link |
@afercia as a followup, I have created a PR as a starting point that adds an aria-label to the link if set to open in a new window with the following format:
|
@ryanwelcher thanks! Worth noting the standard text in core is:
See also #10697 As long as the link content is exclusively text, an |
This is great! A quick note: I would remove |
@afercia @timwright12 I've pushed a change that updates the text and removes @afercia from what I can see in the block, I can't insert an img so I think we're OK. |
Issue Overview
When a user checks "open in a new window" in link settings, add automatically aria-label attribute in the generated link tag :
<a href="..." target="_blank" aria-label="link text - new window">link text</a>
The text was updated successfully, but these errors were encountered: