Disable double-click to reveal source for .copilotmd files in markdown preview (#267517)

* Initial plan

* Disable double-click behavior for .copilotmd files in markdown preview

Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com>

* Update extensions/markdown-language-features/preview-src/index.ts

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com>
Co-authored-by: João Moreno <joaomoreno@users.noreply.github.com>
This commit is contained in:
Copilot
2025-10-03 08:27:59 +00:00
committed by GitHub
parent e39f48a1d5
commit 3a1b1ed83c

View File

@@ -304,6 +304,11 @@ document.addEventListener('dblclick', event => {
return;
}
// Disable double-click to switch editor for .copilotmd files
if (documentResource.endsWith('.copilotmd')) {
return;
}
// Ignore clicks on links
for (let node = event.target as HTMLElement; node; node = node.parentNode as HTMLElement) {
if (node.tagName === 'A') {