Skip to content

Potential fix for code scanning alert no. 3: Inefficient regular expression#38

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

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

Conversation

@jmaxdev
Copy link
Copy Markdown
Collaborator

@jmaxdev jmaxdev commented Apr 19, 2026

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

To fix this safely, make the repeated alternatives mutually exclusive so the engine has a single clear way to consume input.

Best fix in this file: rewrite line 84’s inner group to consume either:

  • an escape sequence (@escapes), or
  • a non-underscore, non-backslash character ([^\\_]), or
  • a single underscore not followed by underscore (_(?!_)).

Putting @escapes first and keeping the other branches disjoint removes the ambiguous overlap under + while preserving intended markdown bold-underscore matching behavior.

Change only this regex in apps/desktop/src/addons/builtin.language.markdown/index.ts in tokenizer.linecontent.

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

Comment thread apps/desktop/src/addons/builtin.language.markdown/index.ts
@jmaxdev jmaxdev marked this pull request as ready for review April 19, 2026 05:37
Comment thread apps/desktop/src/addons/builtin.language.markdown/index.ts Fixed
jmaxdev and others added 3 commits April 19, 2026 02:59
…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>
…expression'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@jmaxdev jmaxdev merged commit 7423a65 into main Apr 19, 2026
7 of 8 checks passed
@jmaxdev jmaxdev deleted the alert-autofix-3 branch April 19, 2026 06:38
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