Skip to content

Commit

Permalink
Add fallbacks for heading extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
daun committed Apr 14, 2024
1 parent 1db3070 commit e0f29d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/announcements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export class Announcer {
type PageAnnouncementOptions = Pick<Options, 'headingSelector' | 'announcements'>;

export function getPageAnnouncement({
headingSelector,
announcements
headingSelector = 'h1',
announcements = {}
}: PageAnnouncementOptions): string | undefined {
const lang = document.documentElement.lang || '*';
const { href, url, pathname: path } = Location.fromUrl(window.location.href);
Expand Down

0 comments on commit e0f29d9

Please sign in to comment.