From 249ea2438625617f74f960ff154f0fdd1d28946a Mon Sep 17 00:00:00 2001 From: Dmitriy Vasyura Date: Fri, 8 May 2026 14:00:13 -0700 Subject: [PATCH] Strip Markdown when announcing chat input notification to screen readers --- .../browser/widget/input/chatInputNotificationService.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.ts b/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.ts index 98cc5ecde157f..a20b8ef80317b 100644 --- a/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.ts +++ b/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { status } from '../../../../../../base/browser/ui/aria/aria.js'; +import { renderAsPlaintext } from '../../../../../../base/browser/markdownRenderer.js'; import { Emitter, Event } from '../../../../../../base/common/event.js'; import { IMarkdownString } from '../../../../../../base/common/htmlContent.js'; import { Disposable } from '../../../../../../base/common/lifecycle.js'; @@ -168,12 +169,16 @@ class ChatInputNotificationService extends Disposable implements IChatInputNotif this._lastAnnouncedSignature = undefined; return; } - const message = typeof active.message === 'string' ? active.message : active.message.value; - const signature = `${active.id}\u0000${message}\u0000${active.description ?? ''}`; + const rawMessage = typeof active.message === 'string' ? active.message : active.message.value; + const signature = `${active.id}\u0000${rawMessage}\u0000${active.description ?? ''}`; if (signature === this._lastAnnouncedSignature) { return; } this._lastAnnouncedSignature = signature; + // Strip Markdown syntax so screen readers don't read backticks, link + // targets, etc. verbatim. Done after the signature check so we don't + // pay the parse cost on unrelated `onDidChange` fires. + const message = renderAsPlaintext(active.message); const text = active.description ? `${message}. ${active.description}` : message; status(text); }