Skip to content

Commit

Permalink
feat(a11y): add alt_text prop to Photo when alt text is available
Browse files Browse the repository at this point in the history
  • Loading branch information
louisgrasset authored and karashiiro committed Aug 13, 2023
1 parent 5791dd2 commit e6dde2b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/timeline-tweet-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export function parseMediaGroups(media: TimelineMediaExtendedRaw[]): {
photos.push({
id: m.id_str,
url: m.media_url_https,
alt_text: m.ext_alt_text,
});
} else if (m.type === 'video') {
videos.push(parseVideo(m));
Expand Down
1 change: 1 addition & 0 deletions src/timeline-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface TimelineMediaExtendedRaw {
type?: string;
url?: string;
video_info?: VideoInfo;
ext_alt_text: string | undefined;
}

export interface SearchResultRaw {
Expand Down
1 change: 1 addition & 0 deletions src/tweets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface Mention {
export interface Photo {
id: string;
url: string;
alt_text: string | undefined;
}

export interface Video {
Expand Down

0 comments on commit e6dde2b

Please sign in to comment.