1
0
mirror of https://github.com/desktop/desktop synced 2024-07-05 00:58:57 +00:00

Add aria labeling to our markdown iframes

This commit is contained in:
tidy-dev 2024-03-08 20:04:37 -05:00
parent f97aced2ba
commit 78fa283e35
4 changed files with 8 additions and 0 deletions

View File

@ -42,6 +42,10 @@ interface ISandboxedMarkdownProps {
readonly markdownContext?: MarkdownContext
readonly underlineLinks: boolean
/** An area label to explain to screen reader users what the contents of the
* iframe are before they navigate into them. */
readonly ariaLabel: string
}
interface ISandboxedMarkdownState {
@ -378,6 +382,7 @@ export class SandboxedMarkdown extends React.PureComponent<
className="sandboxed-markdown-component"
sandbox=""
ref={this.onFrameRef}
aria-label={this.props.ariaLabel}
/>
{tooltipElements.map(e => (
<Tooltip

View File

@ -176,6 +176,7 @@ export abstract class PullRequestCommentLike extends React.Component<IPullReques
onMarkdownLinkClicked={this.onMarkdownLinkClicked}
markdownContext={'PullRequestComment'}
underlineLinks={this.props.underlineLinks}
ariaLabel="Pull request markdown comment"
/>
)
}

View File

@ -216,6 +216,7 @@ export class PullRequestQuickView extends React.Component<
onMarkdownLinkClicked={this.onMarkdownLinkClicked}
onMarkdownParsed={this.onMarkdownParsed}
underlineLinks={this.props.underlineLinks}
ariaLabel="Pull request markdown body"
/>
</div>
)

View File

@ -120,6 +120,7 @@ export class ReleaseNotes extends React.Component<IReleaseNotesProps, {}> {
emoji={this.props.emoji}
onMarkdownLinkClicked={this.onMarkdownLinkClicked}
underlineLinks={this.props.underlineLinks}
ariaLabel="Release notes generated from markdown"
/>
)
}