-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 support for screen reader announcements in code block document elements. #16056
Conversation
if ( direction === 'enter' ) { | ||
return t( 'Entering code snippet' ); | ||
} | ||
|
||
return t( 'Leaving code snippet' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can safely assume there will never be a code snippet without the language upcasted in the editor. See
ckeditor5/packages/ckeditor5-code-block/src/converters.ts
Lines 205 to 207 in 84d1ada
if ( !codeBlock.hasAttribute( 'language' ) ) { | |
writer.setAttribute( 'language', defaultLanguageName, codeBlock ); | |
} |
element.getAttribute( 'language' )!
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can happen if language
passed to codeBlock
has no language definition specified in config (like FooBar
). I'd stay with a bit more verbose but safer approach.
aria-label
attributes to code-block
document element.
@oleq Can you take a look again? |
Suggested merge commit message (convention)
Feature (code-block): Introduced screen reader announcements for entering or exiting code block elements in the document editor. Closes #16053.