diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ea94b2678..6679fbb870 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,7 @@ Legends: - Fixed screen readers announcing a single audio, video, or animation in a card as a list item, such as "1 of 1", fixes [#5722](https://github.com/microsoft/BotFramework-WebChat/issues/5722), in PR [#5903](https://github.com/microsoft/BotFramework-WebChat/pull/5903), by [@OEvgeny](https://github.com/OEvgeny) - Fixed video and animation cards disappearing in production builds when the video URL is relative or invalid, in PR [#5889](https://github.com/microsoft/BotFramework-WebChat/pull/5889), by [@OEvgeny](https://github.com/OEvgeny) - Fixed timestamps always using the 12-hour clock, such as "4:41 PM" instead of "16:41" in German, in PR [#5920](https://github.com/microsoft/BotFramework-WebChat/pull/5920), by [@OEvgeny](https://github.com/OEvgeny) +- Fixed screen readers gluing a link reference marker to the previous word in the message summary, such as "settings1" for `settings[1]`, in PR [#5923](https://github.com/microsoft/BotFramework-WebChat/pull/5923), by [@OEvgeny](https://github.com/OEvgeny) ## [4.19.2] - 2026-10-08 diff --git a/__tests__/html2/accessibility/accessibleName.linkReference.html b/__tests__/html2/accessibility/accessibleName.linkReference.html new file mode 100644 index 0000000000..b1403149a9 --- /dev/null +++ b/__tests__/html2/accessibility/accessibleName.linkReference.html @@ -0,0 +1,74 @@ + + +
+ + + + + + + + + + + + + diff --git a/__tests__/html2/accessibility/accessibleName.linkReference.html.snap-1.png b/__tests__/html2/accessibility/accessibleName.linkReference.html.snap-1.png new file mode 100644 index 0000000000..50fe2b068a Binary files /dev/null and b/__tests__/html2/accessibility/accessibleName.linkReference.html.snap-1.png differ diff --git a/packages/component/src/Utils/activityAltText.ts b/packages/component/src/Utils/activityAltText.ts index ddf5e4e175..4d9c6de664 100644 --- a/packages/component/src/Utils/activityAltText.ts +++ b/packages/component/src/Utils/activityAltText.ts @@ -88,6 +88,9 @@ function htmlTextAlternatives(document: Document): string[] { if (nodeType === Node.TEXT_NODE) { return [textContent]; + } else if (tagName === 'A' || tagName === 'BUTTON') { + // Links and citation buttons are separate words, e.g. "settings[1]" should read "settings 1", not "settings1". + return /\S$/u.test(node.previousSibling?.textContent || '') ? [' '] : []; } else if (tagName === 'IMG') { return [node.getAttribute('alt')]; } else if (!HTML_INLINE_TAGS.includes(tagName)) {