Skip to content

Potential fix for code scanning alert no. 6: Inefficient regular expression#41

Merged
jmaxdev merged 3 commits intomainfrom
alert-autofix-6
Apr 19, 2026
Merged

Potential fix for code scanning alert no. 6: Inefficient regular expression#41
jmaxdev merged 3 commits intomainfrom
alert-autofix-6

Conversation

@jmaxdev
Copy link
Copy Markdown
Collaborator

@jmaxdev jmaxdev commented Apr 19, 2026

Potential fix for https://github.com/TrixtyAI/ide/security/code-scanning/6

General fix: remove ambiguous alternation inside a quantified group by making alternatives mutually exclusive.

Best targeted fix here: in apps/desktop/src/addons/builtin.language.markdown/index.ts, line 88, change:

  • from /`([^\\`]|@escapes)+`/
  • to /`(?:@escapes|[^\\`])+`/

Why this works: putting @escapes first and changing the group to non-capturing removes the problematic overlap during repetition while preserving semantics (content between backticks is either a valid escape or any char except backslash/backtick).

No imports, helper methods, or dependency changes are required.

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

Comment thread apps/desktop/src/addons/builtin.language.markdown/index.ts Fixed
jmaxdev and others added 2 commits April 19, 2026 02:39
…ession

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…expression'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@jmaxdev jmaxdev marked this pull request as ready for review April 19, 2026 05:39
@jmaxdev jmaxdev merged commit fe5b615 into main Apr 19, 2026
7 checks passed
@jmaxdev jmaxdev deleted the alert-autofix-6 branch April 19, 2026 06:43
Comment thread apps/desktop/src/addons/builtin.language.markdown/index.ts Dismissed
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