-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
Needs Accessibility FeedbackNeed input from accessibilityNeed input from accessibilityNeeds DecisionNeeds a decision to be actionable or relevantNeeds a decision to be actionable or relevant[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).Changes that impact accessibility and need corresponding review (e.g. markup changes).[Package] Format library/packages/format-library/packages/format-library[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Introduced in #11063
Previously: #11815 (comment)
Steps to reproduce:
- Navigate to Posts > Add New
- Add a paragraph with at least a few words
- Apply a link to some but not all of the text, enabling the open in New Tab option
- Verify generated HTML in Code Editor
Expected:
<!-- wp:paragraph -->
<p>this is a <a href="http://example.com" target="_blank" rel="noreferrer noopener" aria-label="test (opens in a new tab)">test</a></p>
<!-- /wp:paragraph -->
Actual:
<!-- wp:paragraph -->
<p>this is a <a href="http://example.com" target="_blank" rel="noreferrer noopener" aria-label=" (opens in a new tab)">test</a></p>
<!-- /wp:paragraph -->
(the text of the link, with "(opens in new tab)" appended as a suffix)
Observations:
- At Caret (arrow) followed by a text link breaks content #11815 (comment), the
aria-label
appeared to be assigned to the text of the parent paragraph - In my Steps to Reproduce here, the text generated appears to be empty
Relevant code:
gutenberg/packages/format-library/src/link/inline.js
Lines 52 to 59 in 563ef41
if ( opensInNewWindow ) { | |
// translators: accessibility label for external links, where the argument is the link text | |
const label = sprintf( __( '%s (opens in a new tab)' ), text ).trim(); | |
format.attributes.target = '_blank'; | |
format.attributes.rel = 'noreferrer noopener'; | |
format.attributes[ 'aria-label' ] = label; | |
} |
Metadata
Metadata
Assignees
Labels
Needs Accessibility FeedbackNeed input from accessibilityNeed input from accessibilityNeeds DecisionNeeds a decision to be actionable or relevantNeeds a decision to be actionable or relevant[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).Changes that impact accessibility and need corresponding review (e.g. markup changes).[Package] Format library/packages/format-library/packages/format-library[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended