Skip to content

Conversation

@Git-Hub-Chris
Copy link
Owner

Potential fix for https://github.com/Git-Hub-Chris/MicrosoftVsCode/security/code-scanning/6

To fix this problem, edit the escapeBrackets function to also escape backslashes (\). This must be done before escaping square brackets, since otherwise newly added backslashes (from bracket escaping) themselves may need escaping. Use a regular expression with the global flag to replace each occurrence of a backslash (\) with double backslash (\\), followed by the square bracket escaping as currently done. This fix should only require editing the code on line 305, inside the escapeBrackets function in extensions/markdown-language-features/src/languageFeatures/copyFiles/shared.ts. No new imports are required.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…ng or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Christopher Birnie-Browne <153604499+Git-Hub-Chris@users.noreply.github.com>
@Git-Hub-Chris Git-Hub-Chris marked this pull request as ready for review September 25, 2025 04:17
@Git-Hub-Chris Git-Hub-Chris merged commit f53f927 into Main Sep 25, 2025
11 checks passed
@Git-Hub-Chris Git-Hub-Chris deleted the alert-autofix-6 branch September 25, 2025 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants