Skip to content

Conversation

@Git-Hub-Chris
Copy link
Owner

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

To fix this, the comment end portion of the regex (-->) should be broadened to match both --> and --!>, since both are recognized by browsers as comment end tags. This can be done by replacing --> with --!? (the exclamation mark is optional) followed by >. The correct sequence for regex would be --!?>( to match --> and --!>, so the group becomes (--!?>).

Only line 30 in src/vs/editor/test/common/modes/supports/indentationRules.ts needs to change:

30: 	decreaseIndentPattern: /^\s*(<\/(?!html)[-_\.A-Za-z0-9]+\b[^>]*>|-->|\})/,

should become:

30: 	decreaseIndentPattern: /^\s*(<\/(?!html)[-_\.A-Za-z0-9]+\b[^>]*>|--!?>|\})/,

No additional libraries, functions, or imports are required for this fix.


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

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 24, 2025 22:44
@Git-Hub-Chris Git-Hub-Chris merged commit 0cc02f5 into Main Sep 24, 2025
11 checks passed
@Git-Hub-Chris Git-Hub-Chris deleted the alert-autofix-5 branch September 24, 2025 22:44
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